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

Answers were Sorted based on User's Feedback



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

Answer / hemant jakkani

#include <stdio.h>
#include <string.h>

main()
{
int x,y;
scanf("%d%d",&x,&y);
if(x>y)
printf("First Number is greater: %d",x);
else
printf("Second Number is greater:%d",y);
}

Is This Answer Correct ?    6 Yes 1 No

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

Answer / 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

More C++ General Interview Questions

What are the extraction and insertion operators in c++?

0 Answers  


Is c or c++ more useful?

0 Answers  


Can we distribute function templates and class templates in object libraries?

0 Answers  


Which one is a preferred language C or C++? Why?

0 Answers  


Explain what data encapsulation is in c++?

0 Answers  






Explain what are the sizes and ranges of the basic c++ data types?

0 Answers  


Why are pointers not used in c++?

0 Answers  


What is guard code in c++?

0 Answers  


Is java based off c++?

0 Answers  


Show the declaration for a pointer to function returning long and taking an integer parameter.

0 Answers  


Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?

0 Answers  


Is c++ a pure oop language?

0 Answers  


Categories