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

C++ program output? Explain output of this program. #include <iostream> using std::cout; using std::cin; int main() {   cout<<cout<<' ';   cout<<cin;   return 0; } It prints some address in hexadecimal. what is it?

1 Answers  


reading material is provided 3 books for c++ if u need more do let me know thnx i hve lots of material do let me know if u want it

2 Answers  


Can you explain the term "resource acquisition is initialization?"

1 Answers  


In which memory a class gets stored(in heap /in stack)? And why??

2 Answers  


Difference between Overloading and Overriding?

35 Answers   IBM, NIIT, GameLoft, HP, Appnetix Techno, Rohde and Schwarz,






Brief explaination about #include<iostream.h>, cin and cout

3 Answers  


Explain the ISA and HASA class relationships. How would you implement each in a class design?

2 Answers  


Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)

0 Answers  


What are the differences between public, private, and protected access?

12 Answers   IBM, Wipro, Oracle,


Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);

2 Answers  


5. Can inline functions have a recursion?

4 Answers  


How many pointers are required to reverse a link list?

5 Answers   CTS,






Categories