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() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4
18 Answers HCL, IBM, Infosys, LG Soft, Satyam,
What are segment and offset addresses?
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
You are given any character string. Find the number of sets of vowels that come in the order of aeiou in the given string. For eg., let the given string be DIPLOMATIC. The answer returned must be "The number of sets is 2" and "The sets are "IO and AI". Vowels that form a singleton set must be neglected. Try to post the program executable in gcc or g++ or in java.
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
Write a routine to implement the polymarker function
How to reverse a String without using C functions ?
33 Answers Matrix, TCS, Wipro,
C statement to copy a string without using loop and library function..
Is the following code legal? struct a { int x; struct a *b; }
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }