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 to calculate the BMI of a person using the formula BMI = weight/height2.

2 Answers  


Is it possible for a member function to delete the pointer, named this?

0 Answers  


There are 100 students in a class. The management keep information in two tables. Those two tables are given like Roll no Name Age 001 ABC 15 002 XYZ 14 and Roll No Subject Marks 001 Math 75 001 Physics 55 002 Math 68 001 Hindi 69 They want the information like this Roll No Name Hindi Physics Math Total 001 ABC 69 55 75 199 002 XYZ 68 74 84 226 And Roll No Suject Highest 001 Math 98 007 Physics 84 021 Hindi 74 All 275 All information is kept in structure in main memory. You have to find last two tables.

0 Answers  


What do you mean by stack unwinding in c++?

0 Answers  


Is it possible for the objects to read and write themselves?

0 Answers  






Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

0 Answers  


What are c++ variables?

0 Answers  


What is a flag in c++?

0 Answers  


Explain unexpected() function?

0 Answers  


implement stack using stack.h headerfile functions

1 Answers   Exilant, GMG, Subex, University,


What is std namespace in c++?

0 Answers  


Why is c++ difficult?

0 Answers  






Categories