πŸ“Š C Programming
Q. What is the output of C program with structures?
Code:
int main()
{
    struct ship
    {
        char color[10];
    }boat1, boat2;
    strcpy(boat1.color,"RED");
    printf("%s ",boat1.color);
    boat2 = boat1;
    strcpy(boat2.color,"YELLOW");
    printf("%s",boat1.color);
    return 0;
}
  • (A) RED YELLOW
  • (B) RED RED
  • (C) YELLOW YELLOW
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) RED RED

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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