Computer Science, asked by pappu82, 1 year ago

write a program to accept two no and display their greatest

Answers

Answered by madhurahu2211
1
#include<studio.h>
void main()
{
int a,b;
printf("Enter the two numbers");
scanf("%d %d" , &a &b);
if(a>b)
printf(" the greatest is %d",a);
else
printf("the greatest is %d",b);
}
This is C code

pappu82: hmmm
pappu82: u know
pappu82: java program
madhurahu2211: Yeah.
pappu82: ok
pappu82: in which class u study
madhurahu2211: B.E 2nd year
pappu82: ohh
pappu82: I am in 9 standard
madhurahu2211: ohh
Answered by Meghinie
1
import java.util.scanner
public class java program
{
public static void main ( string args [])
{
int a,b,big;
scanner scan=new scanner ( System.in);
System.out.print("Enter two number:");
a=scan.nextInt()
b=scan.nextInt ()
if (a>b)
{
big=a;
}
else
{
big=b;
}
System.out.println ( "Largest of two number is "+big);
}
}

pappu82: thanks
Similar questions