Skip to main content

Posts

Showing posts with the label For Loop Hackerrank Solution CPP

For Loop Hackerrank Solution CPP

 For Loop Hackerrank Solution CPP For Explanation Watch Video: Sample Input 8 11 Sample Output eight nine even odd Code: #include   < iostream > #include   < cstdio > using   namespace  std; int  main() {      // Complete the code.      int a,b;     cin>>a>>b;     for(int n=a;n<=b;n++){         if(n<=9){             if(n==1){                 cout<<"one"<<endl;             }else if(n==2){              cout<<"two"<<endl;             }else if(n==3){              cout<<"three"<<endl;             }else if(n==4){              cout<<"four"<<endl;             }else if(n==5){              cout<<"five"<<endl;             }else if(n==6){              cout<<"six"<<endl;             }else if(n==7){              cout<<"seven"<<endl;             }else if(n==8){              cout<<"eight"<<endl;