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

Can a program run without main in c++?

575


Explain explicit container.

629


What do you mean by static variables?

595


Does c++ have foreach?

517


What is #include iostream in c++?

583






A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

3235


Can we delete this pointer in c++?

674


Define stacks. Provide an example where they are useful.

569


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

610


What is runtime errors c++?

562


Explain one-definition rule (odr).

635


What are virtual constructors/destructors?

569


What is size_type?

537


On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?

671


What is the role of static keyword for a class member variable?

619