//The Program By Tittu Varghese
//To display n numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,i,n;
i = 1;
printf("How many numbers you need to display ?");
scanf("%d",&n);
while (i <= n)
{b = i;
printf("%d,",b);
i = i+1;
}
getch();
}
//The Program By Tittu Varghese
//To display n even numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,i,n;
i = 2;
printf("How many even numbers you need to display ?");
scanf("%d",&n);
while (i <= (n+n))
{b = i;
printf("%d,",b);
i = i+2;
}
getch();
}
//The Program By Tittu Varghese
//To display n odd numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,i,n;
i = 1;
printf("How many even numbers you need to display ?");
scanf("%d",&n);
while (i <= ((n+n)-1))
{b = i;
printf("%d,",b);
i = i+2;
}
getch();
}
Comments
Post a Comment