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

write a program in c++ to implement stack using functions in header file stack.h

3 Answers   Google, Subex,


Is it possible for a member function to use delete this?

0 Answers  


What is #include cstdlib in c++?

0 Answers  


What is a pure virtual function? Why is it represented as = 0...how is the internal implementation for the same

3 Answers   CTS,


Describe functional overloading?

6 Answers   HP,






Consider the following code fragment: int main(void) { int m = 4; mystery ( m ); mystery ( m ); printf("%d", m); return 0; } What is the output on the monitor if mystery is defined as follows ? void mystery (int m) { m = m+3; }

2 Answers   CDAC, Wipro,


write a program in c++ to generate imp z y x w v w x y z z y x w x y z z y x y z z y z z

4 Answers  


How can I disable the "echo" feature?

0 Answers  


What is the exit function in c++?

0 Answers  


Explain virtual class?

0 Answers  


what is C++ objects?

0 Answers  


what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?

0 Answers  


Categories