+ 1
Write a program to print
a a b a b c a b c d a b c d e
6 Respostas
+ 3
#include <iostream>
using namespace std;
int main() {
for (int i = 0; i<=5; i++){
char a = 'a';
for (int j=0; j<i; j++){
cout<<a++;
}
cout<<endl;
}
return 0;
}
+ 2
You need to loop twice, take a look to my code:
https://code.sololearn.com/cL21OApUzTpx/?ref=app
+ 2
#include <iostream>
using namespace std;
int main() {
string c="";
char a = 'a';
for (int i=0; i<5; i++) {
c+=a;
cout << c <<endl;
a++;
}
return 0;
}
0
please give me the answer with help of for loop
0
hey priyanshu aren't we Coc buddy
0
include<iostream>
using namespace std;
int main()
{
chat A=`a`;
for (int i=0;i<=5;i++){
A=`a`;
for(int j=0;j<=i;j++){
cout<<A;
A++;
} }
return 0;
}