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
Answers were Sorted based on User's Feedback
Answer / guest
d) World, copies World on a, overwrites Hello in a.
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / sandeep tayal
This would produce an error message if you are using g++
compiler in UNIX as g++ does not allow constant strings to
be a part of the char *;
If this is run in Turbo C then it will produce the output
shown in above
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sanjay bhosale
This produces runtime exception as we are attempting to read or write protected memory in Visual c++.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vijeselvam
answer is (d)
The correct answer will be "HelloHello"
Is This Answer Correct ? | 0 Yes | 0 No |
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }
what is the code of the output of print the 10 fibonacci number series
void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(“sizeof (int *) = %d \n”, sizeof(int *)); printf(“sizeof (double *) = %d \n”, sizeof(double *)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
Write a program to print a square of size 5 by using the character S.
What is your nationality?
How we print the table of 2 using for loop in c programing?
main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }
How can u say that a given point is in a triangle? 1. with the co-ordinates of the 3 vertices specified. 2. with only the co-ordinates of the top vertex given.
Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.