Monday, 23 November 2015

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

#include<iostream>
using namespace std;

int main()
{
//By-Ghanendra Yadav
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:-


No comments:
Write comments

Recommended Posts × +