Write a program to accept two numbers and display greatest number between two.
Answers
Answered by
4
Hey mate..
/* C Program - Find Largest of Two Numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a, b, big;
printf("Enter two number : ");
scanf("%d%d",&a,&b);
if(a>b)
{
big=a;
}
else
{
big=b;
}
printf("Biggest of the two number is %d",big);
getch();
}
Hope this helps u...
Please make it BRILLIEST ANSWER.. :)
Answered by
1
Below are the python program and the output for the greatest number from two number:
Output :
If the user input as 3 and 4, then the output will be 4.
If the user input as 1 and 2, then the output will be 2.
Explanation:
Number_1=int(input("Enter the first number: "))#Take the first number.
Number_2=int(input("Enter the Second number: "))#take the second number.
if(Number_1>Number_2):#Compare the number.
print("The Greatest number is:",Number_1)#print the Greatest number.
else:
print("The Greatest number is",Number_2)#it also prints the Greatest number.
Code Explanation :
- The above code is in python language, which takes the two numbers as input after instructing the user for input.
- Then the if and else is used to test the condition to compare the number and find the greater one.
- Then the print statement will print the greater number.
Learn More :
- Python : https://brainly.in/question/14689905
Similar questions