191-049-801, ARAFAT, CSE2102, Lab Report PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Course Title: Introduction to computer &

Programming Techniques
Course Code: CSE2102

LAB REPORT SUBMISSION ON:

Programming Language

Submitted By: Submitted To,

MD. Arafat Hosen Rahatul Islam Udoy


ID: 191-049-801 Lecturer
Section: 01 BUFT
Batch: 191
1st Code:

#include <stdio.h>

int main()

printf("Hello");

return 0;

2nd Code:

#include <stdio.h>

int main()

int l=10;

int w=5;

int A;

A=l*w;

printf("The area is: %d",A);

return 0;

3rd Code:
#include <stdio.h>

int main()

float l=2.5;

float w=1.5;

float h=0.5;

float A;
float V;

A=l*w;

V=l*w*h;

printf("The area is: %f and the volume is %f",A,V);

return 0;

4th Code:
#include <stdio.h>

int main()

float l=10;

float w=5;

float A;

A=l*w;

printf("The area is: %f",A);

return 0;

5th Code:
#include <stdio.h>

int main()

printf("Hello \n How are you? \n Fine");

return 0;

}
6th Code
#include <stdio.h>

int main ()

int l,w;

printf("Enter the length:");

scanf("%d", & l );

printf("Enter the width:");

scanf("%d",& w);

int A;

A=l*w;

printf("The area is: %d", A);

return 0;

7th Code:
#include <stdio.h>

int main()

float Far;

printf("Enter Fahrenheit: ");

scanf("%f",&Far);

float Cen;

Cen=((Far-32)/9)*5;

printf("Centigrade= %f",Cen);

return 0;

}
8th Code
#include <stdio.h>

int main()

int d,c,y,n,p;+

float dr;

printf("Enter Dropping in gms: ");

scanf("%d",&d);

printf("Enter English Count: ");

scanf("%d",&c);

printf("Enter Length woven(yds): ");

scanf("%d",&y);

printf("Enter Number of ends: ");

scanf("%d",&n);

printf("Enter Size add on: ");

scanf("%d",&p);

dr=((840000*d*c)/(454*y*n*p))*100;

printf("The percentage dropping on loom: %f",dr);

return 0;

}
9th Code:
#include <stdio.h>

int main()

int a;

scanf("%d",&a);

if(a>20)

printf("Yes");

else

printf("No");

return 0;

10th Code:

include <stdio.h>

int main()

float w,m,v;

printf("Enter weight: ");

scanf("%f",&w);

printf("Enter molecular mass: ");

scanf("%f",&m);
printf("Enter the volume of the solution: ");

scanf("%f",&v);

float mc; // mc= molar concentration

mc=(w/m)*(1000/v);

printf("Molar concentration= %f",mc);

return 0;

11th Code
#include <stdio.h>

int main ()

float ph;

printf("Enter ph:");

scanf("%f",&ph);

if(ph>7)

printf("Base");

else

printf("Acid");

return 0; }
12th Code
#include <stdio.h>

int main()

float ph;

printf("Enter pH: ");

scanf("%f",&ph);

if(ph>7)

printf("Base");

else if(ph==7)

printf("Neutral");

else

printf("Acid");

return 0; }

13th Code:
#include <stdio.h>

int main()

float cs;

scanf("%f",&cs);
if(cs==14.5)

printf("XS");

else if(cs==15.2)

printf("S");

else if(cs==15.9)

printf("M");

else if(cs==16.7)

printf("L");

else if(cs==17.5)

printf("XL");

else if(cs==18.3)

printf("XXL");

else if(cs==19.5)

printf("XXXL");

}
else

printf("Invalid Size");

return 0;

14th Code:
#include <stdio.h>

int main()

int n;

scanf("%d",&n);

if(n%2==0)

printf("This is an even number");

else

printf("This is an odd number");

return 0;

}
15th Code :
#include <stdio.h>

int main()

int n,a,r1,b,r2,c;

scanf("%d",&n);//n=326

a=n%10;//a=6

r1=n/10;//r1=32

b=r1%10;//b=2

r2=r1/10;//r2=3

c=r2%10;

printf("1st Digit: %d \n 2nd Digit: %d \n 3rd Digit: %d",a,b,c);

return 0;

16th Code :
#include <stdio.h>

int main()

int id,batch;

scanf("%d",&id);

batch=id/10000000;

if(batch==15)

printf("15 Batch");

else if(batch==16)

{
printf("16 Batch");

else if(batch==17)

printf("17 Batch");

else if(batch==18)

printf("18 Batch");

else if(batch==19)

printf("19 Batch");

else

printf("Invalid");

return 0;

17th Code :
#include <stdio.h>

int main()

int i;

for(i=1; i<=5; i++)

{
printf("i am reapting \n");

return 0;

18th Code :

#include <stdio.h>

int main()

int i;

for(i=2; i<=10; i=i+2)

printf("i am reapting %d\n", i);

return 0;

19th Code :

#include <stdio.h>

int main()

int i;

int sum=0;

for(i=1; i<=5; i++)

sum= sum+i;
}

printf(" %d", sum);

return 0;

20th Code :

#include <stdio.h>

int main()

int n;

scanf("%d",&n);

if (n%2==0)

printf("This is an even number");

else

printf("This is an odd number");

return 0;

}
21th Code :

#include <stdio.h>

int main()

{ int id;

scanf("%d",&id);

int batch;

batch=id/10000000;

printf("This is %d batch",batch);

return 0;

You might also like