Programme Code : MCA
Course Code : MCS-011
| More

Year : 2012 Views: 1267 Submitted By : sushant sadashiv belekar On 12th October, 2012

Do you have solution for this Question. If yes    I aslo want solution.

Q.


Write a program to print the following pattern:

a) 1                b)  1

1 2                       2 2

1 2 3                    3 3 3

1 2 3 4                 4 4 4 4

1 2 3 4 5               5 5 5 5 5


Catch The Solution

By gyan


#include

#include

void main()

{

int i,j,num_lines;

clrscr();

printf("\nEnter the number of lines to print: ");

scanf("%d", &num_lines);

for(i=1; i<=num_lines; i++)

{

for(j=1; j<=i; j++)

{

printf("%d ", j);

}

printf("\n");

}

getch();

}




Q Declare two arrays A and B, find (i) A intersection B and (ii) A union B.

sushant sadashiv belekar    12th October, 2012 Hits: 1542