Computer Science
Rewrite the following statement using if-else:
c = (x >= 'A' && x <= 'Z') ? "Upper Case Letter": "Lower Case Letter";
Java Conditional Stmts
1 Like
Answer
if (x >= 'A' && x <= 'Z')
c = "Upper Case Letter";
else
c = "Lower Case Letter";
Answered By
1 Like
Related Questions
Rewrite the following statement using if-else:
net=(salary > 10000) ? salary — (8.33/100)*salary : salary — (5/100)*salary;
Rewrite the following statement using if-else:
s = (a + b < c || a + c <= b || b + c <= a) ? "Triangle is not possible": "Triangle is possible";
Rewrite the following for loop by using while and do-while loops:
for(i=1,j=1;i<=10;i++,j++) { System.out.println(i*j); }
Rewrite the following for loop by using while and do-while loops:
int p = 20; for(k=p;k>=0;k-=2) { s += k; } System.out.println("Sum="+s);