Write program code to display the first 10 even numbers using loop?

2 Answers

Anonymous Profile
Anonymous answered
#include<stdio.h>int main(){ int I=0,count=0; printf("Enter how many even numbers needed:"); scanf("%d",&n); do {   if(I%2==0)   {     printf("%d",I);     count++;   } } while(count<n) return 0;}

Note:here you have asked for 10 numbers so give the input as 10.Sample input:10output:024681012141618

Answer Question