Tuesday, September 24, 2019

C programe :  print even numbers from 1 to 50

pictorial presentation : 
                                      




code : 
//  print even numbers
#include <stdio.h>

int main() {
int i;
printf("Even numbers between 1 to 50 (inclusive):\n");
for (i = 1; i <= 50; i++)
{
if(i%2 == 0)
{
  printf("%d ", i);
}
}
return 0;
}

sample output : 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50


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