A

Admin • 802.91K Points
Coach

Q. What will this code output?

Code:
#include <stdio.h>
int main() {
char str[] = "Hello";
printf("%c", *str);
return 0;
}
  • (A) H
  • (B) e
  • (C) o
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 5
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin
*str gives the first character of the string, which is 'H'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.