Computer Science, asked by boomika546, 6 months ago

write a logic using if statement to find smallest of two numbers​

Answers

Answered by attaamaan007
0

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

Answered by gauritondwal
0

Answer:

Program to Find Smallest between Two Numbers:

  1. Receive any two number as input.
  2. Use if statement to check whether the first number is less than the second number or not.
  3. If it is, then initialize the first number to any variable say small.
  4. If it does not, then go to the else block and initialize the value of second number to any variable say small.
  5. 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

Similar questions