program 1
\*add two number *\
if used turbo c/c++ necessary use getch(); hold screen .
output if a=10
and b=20
sum of number is 30
\*add two number *\
- #include<stdio.h>
- main()
- {
- int a,b,c;
- printf("enter the number");
- scanf("%d%d",&a,&b);
- c=a+b;
- printf("sum of number is %d",c);
- }
if used turbo c/c++ necessary use getch(); hold screen .
output if a=10
and b=20
sum of number is 30
trangle program II
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,r,k=1;
printf("enter the range ");
scanf("%d",&r);
printf("floyd's trangle \n\n");
for (i=1;i<=r;i++)
{
for(j=1;j<=i;j++;k++)
printf("%d",k);
printf("\n");
} return 0;
}
program III
//ftemp=temprature in forenhiet.........
#include<stdio.h>
int main()
{
float ftemp,ctemp;
printf("enter temprature in forrenhiet ");
scanf("%f",&ftemp);
ctemp = ( ftemp - 32)*5/9;
printf("temprature in centigrate = %f",ctemp);
}
int main()
{
float ftemp,ctemp;
printf("enter temprature in forrenhiet ");
scanf("%f",&ftemp);
ctemp = ( ftemp - 32)*5/9;
printf("temprature in centigrate = %f",ctemp);
}
program IV
\*lenght and breath*\
#include<stdio.h>
int main()
{
float l,b,r,ar,pr,ac,cc;
printf("enter the rectangle lenghtand breath of a rectangle ");
scanf("%f%f",&l,&b);
printf("enter the radias of a circle");
scanf("%f",&r);
ar = l*b;
pr = 2*(l*b);
ac = 3.14*r*r;
cc = 2*3.14*r;
printf("area of a rectangle = %f",ar);
printf("perimeter of a rectangle = %f",pr);
printf("area of a circle = %f",ac);
printf("circumference of a circle =%f",cc);
}
two locations
#include<stdio.h>
int main()
{
int c,dl;
printf(" enter the value of c ");
scanf("%d",&%c);
printf(" c=%d, d=%d",d,c);
}
relational operators
such as =,<,>,&&,!!,^,<=,=> etc.
we crossponding few program let us blow
int main()
{
int i;
i=10>8>6;
printf("%d",i);
}