Example of C part 5 print odd number
TO PRINT ODD NUMBER
PROGRAM :
Output:
Enter a Number
10
1
3
5
7
9
PROGRAM :
#include<stdio.h> main() { int i,n; printf("Enter a Number\n"); scanf("%d",&n); for(i=0;i<=n;i++) { if(i%2==1) printf("%d\n",i); else continue; } printf("\n"); }
Enter a Number
10
1
3
5
7
9