62 560
Assignments Done
98,8%
Successfully Done
In June 2018

Answer to Question #28640 in C++ for Amanda

Question #28640
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?
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions