1. Write a Program to print "Welcome in C Language Programming" on the screen.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
printf("Welcome in C Language Programming");
getch();
}
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
printf("Welcome in C Language Programming");
getch();
}
_________________________________________________________________________________
2. Write a Program to print a message 10 times.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int i;
for(i=1; i<=10; i++)
{
printf("Welcome");
}
getch();
}
_________________________________________________________________________________
3. Write a Program that accept a number from user and check it is even or odd.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int a;
printf("Enter the Number:");
scanf("%d",a);
if(a%2 == 0)
printf("Even Number");
else
printf("Odd Number");
getch();
}
_________________________________________________________________________________
4. Write a Program to find even or odd number between 1 to 100 numbers.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int i=100;
clrscr();
for(i=0; i<=100;i++)
{
if(i%2 == 0)
{
printf("\n Number is Even%d",i);
}
else
{
printf("\n Number is Odd%d",i);
}
}
getch();
}
_________________________________________________________________________________
5. Write a Program to convert the Odd Number into Even Number.
Answer :
#include<stdio.h>
#include<conio.h>
Void main()
{
int a;
printf("Enter the Number:");
scanf("%d",&a);
if(a%2!=0)
a= a+1;
printf("Enter Number=%d",a);
getch();
}
*********************************************************************************
0 comments:
Post a Comment