#include<iostream>using namespace std;//main functionint main(){//loop from 0 to 9 number and check if number is odd or evenfor(int i=0;i<10;i++){// using switch case for to check whether no. is even or oddswitch(i%2){ case 0: //show resultcout << "The number "<<i<<" is even\n";break;default: cout << "The number "<<i<<" is odd\n";}}//delaysystem("pause");return 0;}
Comments