Header Ads Widget

C++ program to find the minimum between two numbers

 

 C++ program to find the minimum between two numbers

Given two numbers , write a program to find the minimum between both .

Sample input

5 
4

Sample output

4 is minimum

C++ program to find the minimum between two numbers

The objective of code is to find the minimum between two numbers given by user .

Code(C++):-

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin>>a>>b;
  if(a<b)
   cout<<a<<" is minimum"<<endl;
  else
   cout<<b<<" is minimum"<<endl;
}

Output:-

5
4
4 is minimum


Recommended Post :-

HCL Coding Questions:-

Capgemini Coding Questions:-

Companies interview:-

Full C course:-    

Key points:-

Cracking the coding interview:-

 Array and string:-

Tree and graph:-

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

 MCQs:-