1.write A Program To Print A Message in C Language
1.write A Program To Print A Message in C Language
1.write A Program To Print A Message in C Language
# include<stdio.h>
# include<conio.h>
main()
{
clrscr();
printf("my name is ramesh kr. Yadav this is my first c page");
getch();
}
******output*****
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
clrscr();
a=10,b=20;
c=a+b;
printf("%d",c);
getch();
}
******output*****
# include<conio.h>
main()
{
int a;
clrscr();
printf("enter any number");
scanf("%d",&a);
if(a%2==0)
printf("number is even");
else
printf("number is odd");
getch();
}
******output*******
#include<conio.h>
main()
{
int a,b,temp;
clrscr();
printf("enter first number");
scanf("%d",& a);
printf("enter second number");
scanf("%d",& b);
temp=a;
a=b;
b=temp;
printf("first%d,secon%d",a,&b);
getch();
}
#include<conio.h>
main()
{
int a,b,c;
clrscr();
a=30,b=20;
c=a-b;
printf("%d",c);
getch();
}
******output*****
main()
{
int a,b,c;
clrscr();
printf("enter first number");
scanf("%d",&a);
printf("enter second number");
scanf("%d",&b);
printf("enter third number");
scanf("%d",&c);
if(a>b)
if(a>c)
printf("a is greater");
else
printf("c is greater");
else if (b>c)
printf("b is greater");
else
printf("c is greater");
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr();
printf("enter first number");
scanf("%d",&a);
printf("enter second number");
scanf("%d",&b);
if(a>b)
printf("a is greater");
else
printf("b is greater");
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
float avg;
clrscr();
printf("enter two numbers");
scanf("%d%d",&a,&b);
c=a+b;
printf(sum is %d\n,c);
avg=c/2;
printf("average of two numbers %f",avg);
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int a=1,b=1,c=0,limit;
clrscr();
for(limit=0;limit<=10;limit++)
{
a=b;
b=c;
c=a+b;
printf("%d\n",c);
}
getch();
}