Write a program that declares and initializes two numbers with your roll no and your friend roll no and displays the greater of the two

Declares and initializes two numbers and displays the greater of the two

Write a program that declares and initializes two numbers with your roll no and your friend roll no and displays the greater of the two

Object: Write a program that declares and initializes two numbers with your roll no and your friend roll no and displays the greater of the two C++ projects for beginners with source code

Code:

#include<iostream>

#include<conio.h>

using namespace std;

void main()

{

       int rol_1,rol_2;

       cout<<“Enter Jon Roll Number: “;

       cin>>rol_1;

       cout<<“\nEnter James Roll Number: “;

       cin>>rol_2;

       if(rol_1>rol_2)

       {

              cout<<“\Jon Roll Number is Greater Than James.”;

       }

       else

       {

              cout<<“\James Roll Number is Greater Than Jon.”;

       }

       getch();
}

Output:

Write a program that declares and initializes two numbers with your roll no and your friend roll no and displays the greater of the two

 

 

 

 

M.A Siddiqui

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *