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

Why is c++ still popular?

0 Answers  


Explain selection sorting. Also write an example.

0 Answers  


What are separators in c++?

0 Answers  


What is the difference between static global and global ?

2 Answers   CA,


Write about the members that a derived class can add?

0 Answers  






What is ios flag in c++?

0 Answers  


How much is c++ certification?

0 Answers  


How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

0 Answers  


difference between c and c++?

38 Answers   Cognizant, IBM, Infosys, Oracle, Sarva Shiksha Abhiyan, Wipro,


Why can templates only be implemented in the header file?

0 Answers  


What is an adjust field format flag?

0 Answers  


Explain what data encapsulation is in c++?

0 Answers  


Categories