CSE Lab 1 (Tanvir)
CSE Lab 1 (Tanvir)
The C programming language, developed in the early 1970s by Dennis Ritchie at Bell Labs, is
one of the most influential and widely utilized programming language. It serves as the
foundation for numerous contemporary languages, including C++, Java and Python. In this
report, we will elucidate five fundamental C programs, demonstrating essential
programming concepts such as input/output operations, arithmetic computations, and error
handling. Each program comprises a comprehensive algorithm, flow diagram, code, and
output, which facilitates a thorough understanding of these fundamental principles.
CODE:-
#include<stdio.h>
int main()
return 0;
RESULT:-
Lab task (02) : - 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("ID:240239\n");
printf("Mehrab Hossain Tanvir\n");
printf("Department: Electrical and Electronic Engineering\n");
printf("University: Pabna University of Science and Technology\n");
return 0;
RESULT:-
Lab task (03) : - Write a C program to add two numbers (2 and 6) and display it’s
sum.
CODE:- Flowchart:-
#include<stdio.h> START
int main()
INPUT
num1,num2
{
SUM=num1
+num2
int num1,num2,sum;
sum=num1+num2; END
printf("sum=%d",sum);
return 0;
RESULT:-
Lab task (04) : - Write a C program to multiply two numbers (4 and 5) and display
it’s product.
CODE:- :- Flowchart
START
#include<stdio.h>
MUL=a*b
int a,b,mul;
a=4;
DISPLAY MUL
b=5;
END
mul=a*b;
printf("mul=%d",mul);
return 0;
RESULT:-
Lab task (05) : -Write a C program to input two numbers as input and display it’s
sum.
CODE:- Flowchart :-
#include<stdio.h> START
int num1,num2,sum;
INPUT num2
{
END
sum= num1+ num2;
printf("The sum of %d and %d is:%d\n",num1,num2,sum );
return 0;
}
RESULT:-
DISCUSSION:- Programming will be easy when we can understand it’s basic concepts well and
practice them regularly. While completing this lab report, when I was working on Lab Task 5, I forgot
to use scanf after using printf. I coded multiple times with different code combinations, but I totally
forgot to use scanf. Because of this mistake, I couldn’t get the exact output I wanted. After that, I
read the lab manual again and solved my problem.