main()
{
char *p = "hello world";
p[0] = 'H';
printf("%s", p);
}
a. Runtime error.
b. “Hello world”
c. Compile error
d. “hello world”
Answers were Sorted based on User's Feedback
Answer / deepesh sharma
The Answer is
a) Runtime Error.
Details: hello world is a constant string and the address of
the memory location where this string is stored is assigned
to p. In second line you are changing the value at that
address which is constant string hence changing a constant
is runtime error.
| Is This Answer Correct ? | 18 Yes | 7 No |
Answer / vijayanand yadav ("appu s
compile time error,
because of the semi colon present in the variable char *p="hello world";p[0]='H';here in this example the semi colon is just replaced with a , operator....
| Is This Answer Correct ? | 0 Yes | 8 No |
Link list in reverse order.
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
main() { extern int i; i=20; printf("%d",i); }
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
What is full form of PEPSI
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Display the time of the system and display the right time of the other country
can u give me the c codings for converting a string into the hexa decimal form......
How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...
6 Answers Microsoft, MSD, Oracle,