|
/* Program# 47
date : 28-12-2008
while loop-print odd & even numbers between 1 to 10
*/
#include <stdio.h>
main(){
int n,a;
n=1;
while(n<=10){
a=n%2;
if(!a)
printf("\n Even no:%d",n);
else
printf("\n Odd no:%d",n);
n=n+1;
}
}
output:To compile the program, run the gcc command, $ gcc p47.c |