# Write a program to enter the value of two variables (X and Y). Find and print themaximum value for two variables.

–1 vote
answered Aug 10, 2019 by anonymous
a = input().split(' ')
print(max(int(a[0]),int(a[1])))
–1 vote
answered Aug 10, 2019 by anonymous
x=23

y=55

ifx>y:

print(x)

else:

print(y)
commented Aug 20, 2019 by SWengineer
There is no standard print() function in C++. There is printf() from C, though.
–1 vote
answered Aug 11, 2019 by (120 points)
#include <stdio.h>

int main()
{
int a,b;
scanf("%d%d",&a,&b);
if (a>b)
{
printf("%d is greater ",a);
}
else
{
printf("%d is greater",b);
}

return 0;
}
–1 vote
answered Aug 11, 2019 by Lucifer
#include<stdio.h>
void main()
{
int a,b;
printf("Enter the two numbers:");
scanf("%d,%d",&a,&b);
if(a>b)printf("%d",a);
else if(a<b)printf("%d",b);
else printf("The two numbers are equal");
}
+1 vote
answered Aug 14, 2019 by (300 points)
#include <stdio.h>

int main()
{
int a,b;
scanf("%d%d",&a,&b);
if (a>b)
{
printf("%d is greater ",a);
}
else
{
printf("%d is greater",b);
}
return 1;
}
+1 vote
answered Aug 14, 2019 by (160 points)
#include<iostream>

using namespace std;

int main()

{

int x,y;

cin>>x>>y;

cout<<max(x,y)<<endl;

return 0;

}
+1 vote
answered Aug 14, 2019 by anonymous
x = int(input())

y = int(input())

if x>y:

print(x)

else:

print(y)
answered Aug 15, 2019 by (140 points)
int a = 1, b = 5;
printf("Max = %d", a>b?a:b);
answered Aug 16, 2019 by Ishika Jain
#include<stdio.h>

int main()

{

int x , y , z;

scanf("%d %d",&x,&y);

z = x>y?x:y;

printf("%d",z);

return 0;

}