Computer Applications
State whether the following statement is True or False :
In an if-else statement, the condition is to be defined only with if and not with else.
Input in Java
6 Likes
Answer
True
Answered By
2 Likes
Related Questions
State whether the following statement is True or False :
In a decision making program, 'if' checks whether the condition is true or false.
State whether the following statement is True or False :
You can't assign data values in the main( ) function.
Predict the output of the given snippet, when executed:
int x = 1,y = 1; if(n > 0) { x = x + 1; y = y + 1; } System.out.println(x + " , " + y);
What will be the values of x and y, if the value of n is given as:
(i) 1
(ii) 0 ?Predict the output of the given snippet, when executed:
int b=3,k,r; float a=15.15,c=0; if(k==1) { r=(int)a/b; System.out.println(r); } else { c=a/b; System.out.println(c);