Tuesday, September 24, 2019

C Programe : print odd numbers from 1 to 50



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

Categories

About Me

My photo
I am Md Fakhrul Islam. I am a student of EEE of Daffodil International University I am expert in SEO and Graphic designing.

Contact Form

Name

Email *

Message *

Popular Posts