C program to replace all EVEN elements by 0 and Odd by 1 in One Dimensional Array.
This program will read 10 elements of integer type using One Dimensional Array and replace all EVEN elements by 0 and ODD by 1.
To replace EVEN and ODD elements by 0 and 1, we will check each elements whether it is EVEN or ODD, if it is EVEN assign 0 otherwise assign 1 to the variable with index. For example arr[i] is EVEN, then we will assign arr[i]=0;
Replace EVEN and ODD elements by 0 and 1 using C program
Output
need an explanation for this answer? contact us directly to get an explanation for this answer