Computer Science, asked by ushabaiswar, 7 months ago

write a program to input two numbers and display the largest number​

Answers

Answered by Anonymous
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 ZediTheGreat01
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
History, 1 year ago