write a logic using if statement to find smallest of two numbers
Answers
Answer:
ye computer Ka hai naa chal thk hai brainliest mark kr dena Mai expert hun c++ me
Explanation:
// Write a program in C to find smallest
// between any two given number by user
// ------------codescracker.com------------
#include<stdio.h>
#include<conio.h>
int main()
{
int a, b, small;
printf("Enter any two number: ");
scanf("%d%d", &a, &b);
if(a<b)
small=a;
else
small=b;
printf("\nSmallest of the two number is: %d", small);
getch();
return 0;
}
Receive any two number as input
Use if statement to check whether the first number is less than the second number or not
1.If it is, then initialize the first number to any variable say small
2.If it does not, then go to the else block and initialize the value of second number to any variable say small
3.Print the value of small, that will be the smallest number between the given two
Answer:
Program to Find Smallest between Two Numbers:
- Receive any two number as input.
- Use if statement to check whether the first number is less than the second number or not.
- If it is, then initialize the first number to any variable say small.
- If it does not, then go to the else block and initialize the value of second number to any variable say small.
- Print the value of small, that will be the smallest number between the given two
Explanation:
hope it's helpful to you and plz mark it as a BRAINLIEST ANSWER