#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf(“—————————————\n”);
printf(“I First line :A.Z.M.Shakilur Rahman I\nI Second line :12/a ,Ali sonar lane I\nI Third line:Bogra,5800 I\n”);
printf(“—————————————“);
getch();
}
Problem exercise no. 1.3:
#include<stdio.h>
#include<conio.h>
void main()
{clrscr();
printf(“*\n* *\n* * *\n* * * * “);
getch();
}
Problem exercise no :1.4
#include<stdio.h>
main()
{
printf(” ___ ___\n| | | |\n| | >>——> | |\n| | | |\n|___| |___|”); getch();
}
Problem exercise no:1.5
#include<stdio.h>
#define y 3.1416
main()
{
float x,z;
printf(“enter the vule of radios=”);
scanf(“%f”,&x);
z= ((x*x)* y);
printf(“area of the circle=%f”,z);
getch();
}
Problem exercise no:1.6
#include<stdio.h>
#include<conio.h>
void main()
{
int b,c;
clrscr();
for(b=1;b<=10;b++)
{
c=5*b;
printf(“\n\t%d*%d=%d\n”,5,b,c);
getch();
}
}
Problem exercise no:1.7
#include<stdio.h>
#define a 20
#define b 10
main()
{
int c,d;
c=a+b;
d=a-b;
printf(“20+10=%d\n20-10=%d”,c,d);
getch();
}
Problem exercise no:1.8
#include<stdio.h>
main ()
{
Float x,a,b,c;
printf(“Enter the value of a : “);
scanf(“%f”,&a);
printf(“Enter the value of b : “);
scanf(“%f”,&b);
printf(“Enter the value of c : “);
scanf(“%f”,&c);
x=(a/(b-c));
printf(“x=%f”,x);
getch();
}
b)NO OUTPUT
Problem exercise no:1.9 (b)
#include<stdio.h>
main () { float temp_c, temp_f;
printf (“Enter the value of Temperature in Celcius: “);
scanf (“%f”, &temp_c);
temp_f = (1.8 * temp_c) + 32;
printf (“The value of Temperature in Fahreinheit is: %f”, temp_f);
}
Problem exercise no:1.9 (a)
#include<stdio.h>
#include<conio.h>
void main()
{
float a,F,C;
clrscr();
printf(“ENTER TEMPERATURE IN CELSIUS\n”);
scanf(“%f”,&C);
a=(9*C)/5;
F=a+32;
printf(“\nIn farenhite scale=%f”,F);
getch();
}
Problem exercise no: 1.10
#include<stdio.h>
#include<math.h>
main()
{
float S,a,b,c,A;
printf(“a=”);
scanf(“%f”,&a);
printf(“b=”);
scanf(“%f”,&b);
printf(“c=”);
scanf(“%f”,&c);
S=((a+b+c)/2);
printf(“S=%f\n”,S);
A=(S*(S-a)*(S-b)*(S-c));
printf(“A=%f”,A);
getch();
}
Problem exercise no:1.11
#include<stdio.h>
#include<math.h>
main()
{
int x,x1,y,y1;
float D;
printf(“Enter the value of (x,y) point: \n”);
scanf(“%d%d”,&x,&y);
printf(“Enter the value of (x1,y1) point : \n”);
scanf(“%d%d”,&x1,&y1);
D=sqrt(((x1-x)*(x1-x))+((y1-y)*(y1-y)));
printf(“D=%f”,D);
getch();
}
Problem exercise no:1.12
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define pi 3.14159
int main()
{
float r,x1,x2,y1,y2,A;
x1=0;
x2=0;
y1=4;
y2=5;
r=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
A=pi*r*r;
printf(“Result=%f”,A);
getch();
}
Problem exercise no:1.13
#include<stdio.h>
#include<math.h>
#define pi 3.14159
void main()
{
float D,r,x1,x2,y1,y2,A;
x1=2;
x2=2;
y1=5;
y2=6;
D=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
r=D/2;
A=pi*r*r;
printf(“Result=%f”,A);
getch();
}
Problem exercise no:1.14
#include<stdio.h>
#include<conio.h>
void main()
{ int a,b,c;
clrscr();
a=5;
b=8;
c=18;
printf(“%dx+%dy=%d”,a,b,c);
getch();
}
Problem exercise no:1.15
#include<stdio.h>
#include<conio.h>
void main()
{ float x,y,sum,difference,product,division;
clrscr();
printf(“ENTER TWO NUMBERS=\n”);
scanf(“%f%f”,&x,&y);
sum=x+y;
difference=x-y;
product=x*y;
division=x/y;
printf(“\n\tSum=%f\tDifference=%f\n\n\tProduct=%f\tDivision=%f”,sum,difference,product,division);
getch();
}
No comments:
Post a Comment