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

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

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

Q.


Declare two arrays A and B, find

(i) A intersection B and (ii) A union B.


Catch The Solution

By Pragnesh Chauhan


/*



Write a program to print the following pattern:

a) 1

1 2

1 2 3

. . .







*/





#include

#include

void main()

{

int i,j,n;

clrscr();

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

scanf("%d", &n);

for(i=0;i
{

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

{

printf("%d ",j);

}

printf("\n");

}

getch();

}





/*

--------- OUTPUT ---------------







Enter the number of lines to print: 5

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5







---------------------------------



*/



/*



Write a program to print the following pattern:

a) 1

2 2

3 3 3

. . .

*/



#include

#include

void main()

{

int i,j,n;

clrscr();

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

scanf("%d", &n);

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

{

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

{

printf("%d ", i);

}

printf("\n");

}

getch();

}





/*

--------- OUTPUT ---------------





Enter the number of lines to print: 5

1

2 2

3 3 3

4 4 4 4

5 5 5 5 5





---------------------------------





*/