Skip to main content

Display even numbers from 1 to 'n'

#include <stdio.h> int main() { int n; printf("Enter the value of n : "); scanf("%d" , &n ); printf("\n"); for(int i = 1 ; i <= n; i++ ) { if(i % 2 == 0) printf("%d " , i ); } }





Comments