English

Rewrite the following code using the if-else statement: int m = 400; double cl). = (m>300) ? (m/10.0) * 2:(m/20.0)−2;

Advertisements
Advertisements

Question

Rewrite the following code using the if-else statement: 

int m = 400;
double cl). = (m>300) ? (m/10.0) * 2:(m/20.0)−2;
Code Writing
Advertisements

Solution

int m=400;
double ch;
if (m>300)
   ch=(m/10.0)*2;
else
   ch=(m/20.0)−2;
shaalaa.com
Introduction of Conditional Statements in Java
  Is there an error in this question or solution?
Chapter 1: Revision of Class 9 Syllabus - Exercises [Page 50]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 1 Revision of Class 9 Syllabus
Exercises | Q 16. | Page 50
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×