INTRODUCTION:
C is called mother snd structured programming language. In this
lab report , I draw some flowchart and write some code for problem
solving .So,in the process of solving this problem had to use arithmetic
operation such as summation , multiplication etc.
Lab task 1 :- write a C program to display “This is my first program”
CODE :-
#include<stdio.h>
int main ()
printf("This is my first program");
return 0 ;
RESULT:-
Lab Task:-2. Write a C program to display your Id , name ,Dept Name and
University Name followed by a newline.
CODE:-
#include <stdio.h>
int main(){
printf("Student id:240238\n");
printf("Name:Md.Ridoy Hasan Jihad\n");
printf("Department Name:Electrical & Electronic Engineering \n")
printf("University name:Pabna University Of Science & Technology ")
return 0;
RESULT:-
Lab Task :-3. write a c program to add two numbers ( 2 and 6 ) and display
its sum
CODE:-
Start
#include<stdio.h>
int main ()
{ INPUT 2,6
int a,b,sum;
SUM=2+6
a=2;
b=6;
DISPLAY
sum = a+b; SUM
printf("sum=%d",sum);
return 0 ; END
RESULT:-
Lab Task :-4 . Write A C program to multiply two numbers ( 2 and 8 ) and
display its product .
CODE:-
#include<stdio.h>
int main () STAR
{
INPUT 4,5
int a,b, mul;
a=4; MUL=a*b
b=5;
mul = a*b; DISPLAY
printf("mul=%d",mul); MUL
return 0 ; END
RESULT:-
Lab Task :-5. Write a C program to add two numbers (5 and 8) and display its
sum like
(5 + 8 = 13).
CODE:-
#include <stdio.h> STAR
int main() INPUT a
int a,b,sum; INPUT b
printf("Enter the value of a: ");
scanf("%d",&a);
SUM =
printf("Enter the value of b: "); a+b
scanf("%d",&b);
DISPLAY
SUM
sum = a+b;
printf ("sum=%d",sum);
END
return 0;
RESULT :-
DICUSSION :
Finally I solved lab exercise .Scince I am a new programmer I had to
face some problems .In 3rd no problem, since the value was given 2,6
that’s why scanf cannot be use.In 4 no problems, I didn’t use comma
after the double quote in printf that’s why program didn’t run and
calculate “multiplication” properly.
The end time, I can say that our programming journey would have
been more difficult if we had not followed sir’s lab manual . Since the
manual had some examples,due to which the mistakes were a little
less .