write a program to input two numbers and display the largest number
Answers
Answered by
7
Answer:
Write program to find greatest between two numbers in C
h> void main() { int n1,n2,sum; clrscr(); printf("\nEnter 1st number : "); scanf("%d",&n1); printf("\nEnter 2nd number : "); scanf("%d",&n2); if(n1 > n2) printf("\n1st number is greatest. "); else printf("\n2nd number is greatest.
Answered by
21
In Java
Answer:
import java.util.*;
class Compare
{
public static void main ( String args[ ] )
{
Scanner sc=new Scanner(System.in);
System.out println("Enter a number ");
int a=sc.nextInt();
System.out println("Enter a number ");
int b=sc.nextInt();
if(a>b)
System.out println(a);
else
System.out println(b);
}
}
Ps: mark me as brainliest as I've not written any cut copy paste s.h.i.t likethe other persona
Similar questions
Math,
3 months ago
Political Science,
3 months ago
Science,
7 months ago
English,
7 months ago
Hindi,
1 year ago