Update index.md (#21800)
* Update index.md Finding the bigger number using If Else * Updated index.md * Update index.md * Update index.md
This commit is contained in:
committed by
Randell Dawson
parent
e1fc7c15d6
commit
533adf6743
@ -234,3 +234,20 @@ printf("%.1lf / %.1lf = %.1lf",firstNumber, secondNumber, firstNumber/firstNumbe
|
|||||||
Finally, the break statement ends the switch statement.
|
Finally, the break statement ends the switch statement.
|
||||||
|
|
||||||
If break statement is not used, all cases after the correct case is executed.
|
If break statement is not used, all cases after the correct case is executed.
|
||||||
|
## finding the Bigger among two numbers using if else statement.
|
||||||
|
```C
|
||||||
|
int a,b;
|
||||||
|
printf("Enter the first number: \n");
|
||||||
|
scanf("%d",&a);
|
||||||
|
printf("Enter the second number: \n");
|
||||||
|
scanf("%d",&b);
|
||||||
|
//comparing the numbers
|
||||||
|
if(a>b)
|
||||||
|
{
|
||||||
|
printf("A is the Bigger number");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("B is the bigger number");
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user