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?
#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;
}