with a suitable example explain how to apply condition in programming? Write the coding block of it to
Answers
Answer:
Conditional Statements in C programming are used to make decisions based on the conditions. Conditional statements execute sequentially when there is no condition around the statements. If you put some condition for a block of statements, the execution flow may change based on the result evaluated by the condition. This process is called decision making in 'C.'
Explanation:
mark as brainlist
Answer:
in Java :
import java.util.Scanner;
public class Main
{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
System.out.println("Enter a number");
int num1 = scan.nextInt();
if(num1>0){
System.out.println("This number is positive");
}
else if(num1==0){
System.out.println("This number 0");
}
else if(num1<0){
System.out.println("This number is negitive");
}
else{
System.out.println("invalid number");
}
}
}
}
//mark me brainist