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
πŸ’¬ Discuss
βœ… Correct Answer: (A) H
Explanation: *str gives the first character of the string, which is 'H'.
Explanation by: Mr. Dubey
*str gives the first character of the string, which is 'H'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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