We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<string>#include<iostream>#include<cstdio>usingnamespacestd;intmain(){// Complete the code.intnum1,num2;cin>>num1>>num2;stringarr[]={"one","two","three","four","five","six","seven","eight","nine"};for(intn=num1;n<=num2;n++){if(n<=9&&n>=1){cout<<arr[n-1]<<endl;}elseif(n>9&&n%2==0){cout<<"even"<<endl;}else{cout<<"odd"<<endl;}}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
For Loop
You are viewing a single comment's thread. Return to all comments →