Q. What is the output of the following C++ code?

Code:
#include <iostream>
using namespace std;
main()
{
  double x = 15.564702;
  float y = 5.99;
  int z ,w;
  z = (int) x;
  w = (int) y;
  cout << z <<' '<< w;
  return 0;
}
  • (A) 15 6
  • (B) 14 6
  • (C) 15 5
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) 15 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

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