Write a program to input the limit from the user and print all the even and odd numbers up to that?
#include<stdio.h> int main() { int i=1,n; printf("Enter any number: "); scanf("%d",&n); do { if(i%2==0) printf("Even number %d\n",i); else printf("Odd number %d\n",i); i++; }while(i<=n); return 0; }
Output
