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 is lambda expression c++?

0 Answers  


Define the operators that can be used with a pointer.

0 Answers  


What is the use of :: operator in c++?

0 Answers  


What do you mean by const correctness?

0 Answers  


What is difference between array and vector in c++?

0 Answers  


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

0 Answers  


Why do we need templates?

0 Answers  


What are single and multiple inheritances in c++?

0 Answers  


Describe protected access specifiers?

0 Answers  


What is extern c++?

0 Answers  


which is the easy way to divide any integer by 2?

2 Answers   Persistent,


Please explain the reference variable in c++?

0 Answers  


Categories