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 |
Find the largest number in a binary tree
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }
Write a C program to add two numbers before the main function is called.
why the range of an unsigned integer is double almost than the signed integer.
How do you create a really large matrix (i.e. 3500x3500) in C without having the program crash? I can only reach up to 2500. It must have something to do with lack of memory. Please help!
main() { int i=5; printf(“%d”,i=++i ==6); }
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.
String reverse with time complexity of n/2 with out using temporary variable.
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }