write a program that takes two numbers from user that
prints the smallest number

Answer Posted / vaishnavi

#include<iostream.h>
void main()
{
int a,b;
cout<<"Enter two numbers";
cin>>a>>b;
if(a>b)
cout<<a<<"is greater";
else
cout<<b<<is greater";
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1613


What is the difference between an external iterator and an internal iterator?

710


Why is c++ awesome?

661


What is vector processing?

767


what is C++ exceptional handling?

712






Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

646


What is pointer -to-members in C++? Give their syntax?

688


What are the defining traits of an object-oriented language?

790


What are compilers in c++?

700


What relational operators if statements in c++?

761


What is data abstraction? How is it different from data encapsulation?

617


Is there any function that can skip certain number of characters present in the input stream?

667


What is the meaning of string in c++?

662


Explain how functions are classified in C++ ?

900


What is name hiding in c++?

737