Write a program to print the following pattern by using loops or any other method?
11
13 15
15 17 19
17 19 21 23
19 21 23 25 27
21 23 25 27 29 31
How about you give it a whirl and report back with your code if you still need help.
Code:
#include<iostream.h>
void main()
{
for(int a=01; a<=5; a++)
{for( int c=a; c<=a ; c++)
{for(int b=a;b<=a+c;b++)
{cout<<b<<" ";}
cout<<endl;
}
}}
output:
1 2
2 3 4
3 4 5 6
4 5 6 7 8
5 6 7 8 9 10
press any key to continue_
How to modify this code to print out the above requested series!!!!!Please help me with this code.