Write the program to display the following output :
Solution:
#include <iostream.h>
int main ()
{
int i, j , n = 1;
for(i = 1; i <= 7; i++)
{
for(j =1; j <= i; j++)
{
cout<< n <<" ";
n = n + 2 ;
}
cout<<endl ;
}
return 0;
}
No comments:
Post a Comment
If you have any doubt please let me know