HP
Programming and Technical
Programming
int n=20,k;
k=(n>6)?(n<=10?100:200):500;
Read Solution (Total 7)
-
- The ans is 200
- 8 years agoHelpfull: Yes(1) No(0)
- 20>6 true so now check 20
- 8 years agoHelpfull: Yes(0) No(0)
- 200 is the ans
- 8 years agoHelpfull: Yes(0) No(0)
- It cheks 20 >6 so the answer is 200
- 7 years agoHelpfull: Yes(0) No(0)
- 200 ist condition is true and 2nd is false
- 7 years agoHelpfull: Yes(0) No(0)
- since n=20 is > 6 middle statement will be executed , now n is not less than 10 hence 200 is the output
- 7 years agoHelpfull: Yes(0) No(0)
- 200 is the answer because it checks from right to left
- 5 years agoHelpfull: Yes(0) No(0)
HP Other Question