A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a program in C++ to compare two numbers
Q:

Write a program in C++ to compare two numbers

0

Write a program in C++ to compare two numbers

Sample Output:

 Compare the first number with second number numbers:                  
---------------------------------------------------------              
 Input the first integer: 25                                           
 Input the second integer: 15                                          
25 != 15                                                               
25 > 15                                                                
25 >= 15

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
using namespace std;
 
int main()
{
int num1,num2;
    cout << "\n\n Compare the first number with second number numbers:\n";
	cout << "---------------------------------------------------------\n";
	cout << " Input the first integer: ";
	cin>> num1;
	cout << " Input the second integer: ";
	cin>> num2;	
	
		if ( num1 == num2 )           
            cout<< num1<< " == " << num2 <<endl;  
        if ( num1 != num2 )          
            cout<< num1<<" != " << num2<<endl; 
        if ( num1 < num2 )          
            cout<< num1<< " < "<<num2<<endl; 
        if ( num1 > num2 )          
            cout<< num1<<" > "<< num2 <<endl; 
        if ( num1 <= num2 )          
            cout<<num1<<" <= "<< num2<<endl; 
        if ( num1 >= num2 )          
            cout<<num1<< " >= "<< num2<<endl; 	
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now