Powered By Blogger

Monday, May 4, 2009

C Programming

#include
#include
void main()
{
int a,n,b,count=0;
clrscr();
printf(" Enter your first&&second number:");
scanf("%d%d",&a,&n);
printf(" what do you want to do:\n");
printf(" For odd number:press 1:&&For even number press 2:");
printf("\n Please press a number:");
scanf("%d",&b);
if(b==1)
{
printf(" ");
while(a<=n)
{
if(a%2==1)
{
count=count+1;
if(count==20||count==40||count==60)
printf("\n ");
printf("%d ",a);
}
a=a+1;
}
}
else
{
printf(" ");
while(a<=n)
{
if(a%2==0)
{
count=count+1;
if(count==20||count==40||count==60)
printf("\n ");
printf("%d ",a);
}
a=a+1;
}
}
getch();
}

0 comments:

About This Blog

This is an important blog about updated news about computer science and technology.

Blog Archive

Visitors

  © Free Blogger Templates Blogger Theme II by Ourblogtemplates.com 2008

Back to TOP