Q:

Write A C++ Program To Print INDIA Pattern As Given Below

0

Write A C++ Program To Print INDIA Pattern As Given Below

I
I N
I N D
I N D I
I N D I A

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<iostream>
using namespace std;

int main()
{
char s[]="INDIA";
int i,j;
for(i=0;s[i];i++)
{
for(j=0;j<=i;j++)
cout<<s[j];
cout<<"\n";
}
return 0;
}

 

Output:

I
I N
I N D
I N D I
I N D I A

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now