Q. What is the output of the following code?

Code:
#include <stdio.h>
int main() {
    char str[] = "Hello";
    printf("%c", *str);
    return 0;
}
  • (A) H
  • (B) e
  • (C) Hello
  • (D) Compilation Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) H
Explanation: *str gives the first character of the string.
Explanation by: Mr. Dubey
*str gives the first character of the string.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
56
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
91%
Success Rate