Question 3490 – Environment
February 16, 2024NTA UGC NET JUNE 2023 Paper-1
February 16, 2024KVS 30-12-2018 Part B
Question 18 |
What shall be the output of the following program in C++(using turbo C++)?
#include<iostream.h>
float answer;
main()
{
answer=⅓;
cout<<”The value of ⅓ is” <<answer,,”\n”;
return(0);
}
#include<iostream.h>
float answer;
main()
{
answer=⅓;
cout<<”The value of ⅓ is” <<answer,,”\n”;
return(0);
}
The value of ⅓ is 0 | |
The value of ⅓ is 0.33 | |
The value of ⅓ is 0.3333 | |
The value of ⅓ is 1/3 |
Question 18 Explanation:
The expression answer=⅓ , which is integer divide by integer operation .
Modulus operation gives the quotient values when one number is divided by another number .
When 1 is divide by 3, the quotient is o
Modulus operation gives the quotient values when one number is divided by another number .
When 1 is divide by 3, the quotient is o
Correct Answer: A
Question 18 Explanation:
The expression answer=⅓ , which is integer divide by integer operation .
Modulus operation gives the quotient values when one number is divided by another number .
When 1 is divide by 3, the quotient is o
Modulus operation gives the quotient values when one number is divided by another number .
When 1 is divide by 3, the quotient is o