a) Write a program to print following pattern: 1 1 1 2 1 3 2 3 4 [2x2.5] 4 5 b) Write a program to input two one dimensi
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
a) Write a program to print following pattern: 1 1 1 2 1 3 2 3 4 [2x2.5] 4 5 b) Write a program to input two one dimensi
in c language
a) Write a program to print following pattern: 1 1 1 2 1 3 2 3 4 [2x2.5] 4 5 b) Write a program to input two one dimensional array A and B in sorted order and merge them in third array C in reverse sorted array. Note that you are not allowed to use any sorting techniques in the array C.
void foo() ( char a[]="NITJ"; char b[]="NITJ"; if (a - b) printf("Same"); printf("Different"); else } void main() { int i; printf("NITJ\n"); for(i=0;i<5;i++) main(); } void fun(char *m) { if(*m && *m != '') { fun(a+1); putchar(*m); } } void main() { int x,y,z, x=y=z=-1; z = ++x || ++y && ++z; printf("x=%d,y=%d,z-%d",x,y,z); } void foo() { char s[5]="abcd", *k; k=s+1; *k='0'; printf("%s",s); } void foo(int a, int b) { if(b!=1) if(a!=1) { printf("NITJ"); foo(a/2,b); } Input: NIT Jalandhar (It will be else given) { b--; foo(1024,b); } Question: Compute the numbe times NITJ will be printed whe and b are 1024 and respectively. 2