main()
{
char a[4]="HELL";
printf("%s",a);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
HELL%@!~@!@???@~~!
Explanation:
The character array has the memory just enough to hold the
string “HELL” and doesnt have enough space to store the
terminating null character. So it prints the HELL correctly
and continues to print garbage values till it accidentally
comes across a NULL character.
Is This Answer Correct ? | 25 Yes | 10 No |
Answer / harshawardhan
HELL
It will print "HELL" because Character array of size 0 to 4 mean it may hold 5 places. One for Null character and other four for HELL total 5.
Is This Answer Correct ? | 3 Yes | 0 No |
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O
Is the following code legal? struct a { int x; struct a b; }
Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).
write a program for area of circumference of shapes
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
Display the time of the system and display the right time of the other country
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.
why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?
main() { int i=10; void pascal f(int,int,int); f(i++,i++,i++); printf(" %d",i); } void pascal f(integer :i,integer:j,integer :k) { write(i,j,k); }
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }