Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 175

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 65

Answer:

main()
{
char a[4]="HELL";
printf("%s",a);
}


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.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 175 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: