Largest Value Program

Q) Write a program to read two numbers from the keyboard and display the largest value of them?

Answer:

// if-else structure
#include <iostream.h>
void main (void)
{
float x,y;
cout << “Enter any two numbers \n”;
cin >> x >> y;
if(x>y)
cout << “Largest value is ” << x << endl;
else
cout << “Largest value is ” << v << endl;
}

It's very calm over here, why not leave a comment?

Leave a Reply

You must be logged in to post a comment.