A

Admin • 833K Points
Coach

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
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category C Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.