code
// print odd numbers
#include <stdio.h>
int main() {
int i;
printf("odd numbers between 1 to 50 (inclusive):\n");
for (i = 1; i <= 50; i++)
{
if(i%2 == 1)
{
printf("%d ", i);
}
}
return 0;
}
sample output : 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 2 , 29, 31, 33, 35, 37, 39, 41, 43 , 45,47,49
0 Comments:
Post a Comment