Answer to Question #28640 in C++ for Amanda
2013-04-16T22:33:13-04:00
How do you write the whole alphabet using a for statement?
How do you write the whole alphabet using a while statement?
How do you write the whole alphabet using a do while statement?
1
2013-04-18T10:18:43-0400
#include<iostream> using namespace std; int main(){ & cout<<"for loop : \n"; for(int i = 'a';i<'z'+1;i++) & cout<<(char)i; & cout<<"\nwhile loop : \n"; char init = 'a'; while(init < 'z'+1){ & cout<<init++; } cout<<"\ndo while loop : \n"; init = 'a'; do{ & cout<<init++; } while(init < 'z'); & return 0; }
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS !
Learn more about our help with Assignments:
C++
Comments
Leave a comment