String copy logic in one line.
Answers were Sorted based on User's Feedback
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }
Write a C program to add two numbers before the main function is called.
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above
4 Answers Corporate Society, HCL,
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }
main() { char not; not=!2; printf("%d",not); }
Who could write how to find a prime number in dynamic array?
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
main() { static int var = 5; printf("%d ",var--); if(var) main(); }
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
why the range of an unsigned integer is double almost than the signed integer.
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }