Green University of Bangladesh Department of Computer Science and Engineering (CSE)
Green University of Bangladesh Department of Computer Science and Engineering (CSE)
Student Details
Name ID
1.
[For Teachers use only: Don’t Write Anything inside this box]
OBJECTIVES/AIM:
Procedure:
Algorithm:
1) Start the program
2) Take input a=4 ,b=5
3) Multiply both the numbers
4) Print the result.
5) End
Implementation:
#include<stdio.h>
int main()
{
int a, b, multiply;
a = 4;
b = 5;
multiply = a*b;
printf("Multiply is: %d\n", multiply);
}
Output:
Answer to the question number 5:
Procedure:
Algorithm:
1) Start the program
2) Take input a=5 ,b=8 and sum=13
3) Print the result.
4) End
Implementation:
#include<stdio.h>
int main()
{
int a, b, sum;
a = 5;
b = 8;
sum=13;
printf("5+8=: %d\n", sum);
}
Output:
Answer to the question number 6:
Procedure:
Algorithm:
1. Start the program
2. Take a, b
3. Enter the two numbers
4. print the two numbers
5. End
Implementation:
#include<stdio.h>
int main()
{
int a, b;
printf("Enter the first number:");
scanf("%d",&a);
printf("Enter the second number:");
scanf("%d",&b);
printf("The two numbers are:%d\t%d",a,b);
}
Output:
Procedure:
Algorithm:
1. Start the program
2. Take input a, b,
3. Enter the two numbers
4. Sum the two numbers
5. Print the sum
Implementation:
#include<stdio.h>
int main()
{
int a, b, sum;
printf("Enter the first number:");
scanf("%d",&a);
printf("Enter the second number:");
scanf("%d",&b);
sum=a+b;
printf("The sum is:%d\n",sum);
}
Output:
Procedure:
Algorithm:
1. Start the program
2. Take input a, b,
3. Enter the two numbers
4. Product the two numbers
5. Print the product
Implementation:
#include<stdio.h>
int main()
{
int a, b, product;
printf("Enter the first number:");
scanf("%d",&a);
printf("Enter the second number:");
scanf("%d",&b);
product=a*b;
printf("The product is:%d\n",product);
}
Output:
Procedure:
Algorithm:
1. Start the program
2. Take input a, b,
3. Enter the two numbers
4. Product the two numbers
5. Print the product
Implementation:
#include<stdio.h>
int main()
{
float a, b, sum;
printf("Enter the first number:");
scanf("%f",&a);
printf("Enter the second number:");
scanf("%f",&b);
sum=a+b;
printf("2.36+3.36=:%.2f\n",sum);
}
Output:
This experiment is the first code written in C program. The program is focused on the
syntax and structure of C programming. From this lab, I understood the basic structure
of C programming including the meaning of header files & steps of problem solving.
Hence, sum, multiplication of numbers are calculated and displayed.