πŸ“Š C Programming
Q. What is the output of C program with strings?
Code:
int main()
{
    char str1[]="JOHN";
    char str2[20];
    str2= str1;
    printf("%s",str2);
    return 0;
}
  • (A) J
  • (B) JOHN
  • (C) JOHN\0
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
202
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
93%
Success Rate