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

What is the arrow operator in c++?

562


What is the need of a destructor?

638


What is class syntax c++?

595


How do you clear a map in c++?

571


What is the function of I/O library in C++ ?

668






What is the difference between the parameter to a template and the parameter to a function?

638


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

590


Why should you learn c++?

587


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

544


What are the two types of comments?

576


What is the maximum value of a unsigned char a) 255 b) 256 c) 128

636


What is pair in c++?

628


What is string in c++ programming?

627


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

551


Explain Memory Allocation in C/C++ ?

640