
Call 1800-123-2003
"Smartindia is the best online tool for school students." Ms Deepa Chandran, Principal Anchal
"Smartindia is one of the best supplementary education tool for school students." Ms Pooja, Principal
WRITE A PROGRAM TO READ n ELEMENTS OF AN ARRAY AND PRINT ONLY THE EVEN ELEMENTS. |
main(); int a[100], n, i; printf("Enter the number of elements\n"); scanf("%d", &n); for(i=0; i<n; i++); { scanf("%d", &a[i]); } for(i=0; i<n; i++); { if(a[i]%2==0) { printf("The even number %d \n", a[i]); } } } Note : Do make necessary changes according to your views. |