C++ Program to display like in attachment !!! Use For loop or Do while or While loop !!
Attachments:
Answers
Answered by
2
#include<iostream.h>
using namespace std;
int main()
{
int i,j=1,k=1,n,g=1;
for(i=1; i<= 4; i++)
{
cout << "\n" <<g<<"\t"<<k<<endl;
j = j + 1;
k = k + j;
g = g + 1;
}
return 1;
}
The output in the screenshot.
Hope this helps!.
using namespace std;
int main()
{
int i,j=1,k=1,n,g=1;
for(i=1; i<= 4; i++)
{
cout << "\n" <<g<<"\t"<<k<<endl;
j = j + 1;
k = k + j;
g = g + 1;
}
return 1;
}
The output in the screenshot.
Hope this helps!.
Attachments:
siddhartharao77:
:-)
Similar questions