0% found this document useful (0 votes)
6 views3 pages

05 Programs

Uploaded by

malikshanii458
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

05 Programs

Uploaded by

malikshanii458
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

5…1

#include<iostream>

using namespace std;

int main()

int n1,n2,n3;

cout<<"Enter three numbers: ";

cin>>n1>>n2>>n3;

if(n1>=n2&&n1>=n3)

cout<<"Largest number is: "<<n1;

if(n2>=n1&&n2>=n3)

cout<<"Largest number is: "<<n2;

if(n3>=n1&&n3>=n2)

cout<<"Largest number is: "<<n3;

return 0;

5…2

#include<iostream>

using namespace std;

int main()

int s,g,b;

cout<<"Enter salary of Employee: ";

cin>>s;

if(s>40000)
b=.05*s;

g=b+s;

if(s<40000)

b=.1*s;

g=b+s;

cout<<"Salary after increment is : "<<g;

return 0;

5….3

#include<iostream>

using namespace std;

int main()

char oper;

float num1, num2;

cout<<"Enter an operator(+,-,*,/): ";

cin>>oper;

cout<<"Enter two numbers : "<<endl;

cin>>num1>>num2;

switch(oper)

case'+':

cout<<num1<<"+"<<num2<<"="<<num1+num2;

break;

case'-':
cout<<num1<<"-"<<num2<<"="<<num1-num2;

break;

case'*':

cout<<num1<<"*"<<num2<<"="<<num1*num2;

break;

case'/':

cout<<num1<<"/"<<num2<<"="<<num1/num2;

break;

default:

cout<<"Error! The operator is not correct ";

break;

You might also like