/*MAXIMUM BETWEEN three NUMBERS*/
#include
using namespace std;
int main()
{
int num1;
int num2;
int num3;
cout << "Enter the number 1:" << endl;
cin >> num1;
cout << "Enter the number 2:" << endl;
cin >> num2;
cout << "Enter the number 3:" << endl;
cin >> num3;
if (num1 > num2 && num1 > num3)
{
cout << num1 << " is greater than " << num2 << " and " << num3 << endl;
}
else if (num2 > num1 && num2 > num3)
{
cout << num2 << " is greater than " << num1 << " and " << num3 << endl;
}
else
{
cout << num3 << " is greater than " << num1 << " and " << num2 << endl;
}
return 0;
}
// Check Number is positive or negative or zero
#include
using namespace std;
int main()
{
int num;
cout << "Enter the number :" << endl;
cin >> num;
if (num > 0)
{
cout << "It is a positive number:" << endl;
}
else if (num < 0)
{
cout << "It is negative number:" << endl;
}
else
{
cout << "It is a zero:" << endl;
}
return 0;
}
// Check year is a leap year or not
#include
using namespace std;
int main()
{
int year;
cout << "Enter the year:" << endl;
cin >> year;
if (year % 4 == 0)
{
cout << "It is a leap year:" << endl;
}
else
{
cout << "It is not a leap year:" << endl;
}
return 0;
}
// Character is alphabat or not
#include
using namespace std;
int main()
{
char ch;
cout << "Enter the character:" << endl;
cin >> ch;
// Range of small letters ASCII==(97-122)
// Range of Capital letters ASCII==(65-90)
if ((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122))
{
cout << "It is a character. It is \"" << ch << "\"." << endl;
}
else
{
cout << "It is not a character:" << endl;
}
return 0;
}
// Vowel or constant check
#include
using namespace std;
int main()
{
char ch;
cout << "Enter the letter a to z:" << endl;
cin >> ch;
if ((ch == 'a' || ch == 'A') || (ch == 'e' || ch == 'E') || (ch == 'i' || ch == 'I') || (ch == 'o' || ch == 'O') || (ch == 'U' || ch == 'u'))
{
cout << "It is vowel as \"" << ch << "\"." << endl;
}
else
{
cout << "It is a consonanat:" << endl;
}
return 0;
}
// digit ,letter and special letter detecter
#include
using namespace std;
int main()
{
char ch;
cout << "Enter the any letter ,number and special character:" << endl;
cin >> ch;
// Range of small letters ASCII==(97-122)
// Range of Capital letters ASCII==(65-90)
// Range of NUmbers ASCII==(48-57)
// Other than these range are all special characters range
if ((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122))
{
cout << "It is an letter as \"" << ch << "\" with an ascii value of " << static_cast(ch) << "." << endl;
}
else if (ch >= 48 && ch <= 57)
{
cout << "It is an number as \"" << ch << "\" with an ascii value of " << static_cast(ch) << "." << endl;
}
else
{
cout << "It is an special character as \"" << ch << "\" with an ascii value of " << static_cast(ch) << "." << endl;
}
return 0;
}
// Uppercase or lower case check
#include
using namespace std;
int main()
{
char ch;
cout << "Enter the letter :" << endl;
cin >> ch;
if (ch >= 65 and ch <= 90)
{
cout << "It is an uppercase letter:" << endl;
}
else if (ch >= 97 and ch <= 122)
{
cout << "It is an lowercase lettter:" << endl;
}
return 0;
}
/*Days given by month*/
#include
#include
using namespace std;
int main()
{
string month;
int year;
cout << "Enter the name of month" << endl;
cin >> month;
if (month == "februray" || month == "Februray" || month == "FEBRURAY")
{
cout << "Enter the year to check it is leap yaer or not:" << endl;
cin >> year;
if (year % 4 == 0)
{
cout << "It is a leap year and it conatines 29 days in Februray:" << endl;
}
else
{
cout << "It is not a leap year so it conatines 28 days in February" << endl;
}
}
else
{
if (month == "januray" || month == "Januray" || month == "JANURAY")
{
cout << "Januray conatines 31 days:" << endl;
}
if (month == "march" || month == "March" || month == "MARCH")
{
cout << "MARCH conatines 31 days:" << endl;
}
if (month == "April" || month == "april" || month == "APRIL")
{
cout << "April conatines 30 days:" << endl;
}
if (month == "May" || month == "may" || month == "MAY")
{
cout << "May conatines 31 days:" << endl;
}
if (month == "june" || month == "June" || month == "JUNE")
{
cout << "June conatines 30 days:" << endl;
}
if (month == "July" || month == "july" || month == "JULY")
{
cout << "July conatines 31 days:" << endl;
}
if (month == "August" || month == "august" || month == "AUGUST")
{
cout << "August conatines 30 days:" << endl;
}
if (month == "September" || month == "september" || month == "SEPTEMBER")
{
cout << "September conatines 30 days:" << endl;
}
if (month == "October" || month == "october" || month == "OCTOBER")
{
cout << "October conatines 31 days:" << endl;
}
if (month == "November" || month == "november" || month == "NOVEMBER")
{
cout << "November conatines 30 days:" << endl;
}
if (month == "December" || month == "december" || month == "DECEMBER")
{
cout << "December conatines 31 days:" << endl;
}
}
return 0;
}
// triangle is valid or not
#include
#include
using namespace std;
int main()
{
float angle1;
float angle2;
float angle3;
float sum = 0;
cout << "Enter the angle 01 of the triangle:" << endl;
cin >> angle1;
cout << "Enter the angle 02 of the triangle:" << endl;
cin >> angle2;
cout << "Enter the angle 03 of the triangle:" << endl;
cin >> angle3;
cout << setprecision(2) << fixed;
sum = angle1 + angle2 + angle3;
if (sum == 180.00)
{
cout << "This is a triangle:" << endl;
}
else
{
cout << "This is not a triangle:" << endl;
}
return 0;
}
//To check triangle is osscoles and equliteral andscalance
#include
using namespace std;
int main()
{
float side1;
float side2;
float side3;
bool flag=false;
cout<<"Enter the value of side1:"<>side1;
cout<<"Enter the value of side2:"<>side2;
cout<<"Enter the value of side3:"<>side3;
if(side1==side2 &&side2==side3)
{
cout<<"It is an equiliteral triangle:"<
//Check triangle is valid or not by input of its sides
#include
#include
using namespace std;
int main()
{
float side1;
float side2;
float side3;
bool flag=false;
cout<<"Enter the value of side1:"<>side1;
cout<<"Enter the value of side2:"<>side2;
cout<<"Enter the value of side3:"<>side3;
//a^2=b^2+c^2
if(side1==sqrt(pow(side2,2)+pow(side3,2)))
{
flag=true;
}
else if(side2==sqrt(pow(side1,2)+pow(side3,2)))
{
flag=true;
}
else if(side3==sqrt(pow(side2,2)+pow(side1,2)))
{
flag=true;
}
if(flag==false)
{
cout<<"It is not a triangle:"<
//Roots of the qudratic equation
#include
#include
using namespace std;
int main()
{
int a;
int b;
int c;
double disc;
double root1;
double root2;
cout<<"Quadratic equation is writtten as \"ax^2+bx+c\""<>a;
cout<<"Enter the value of bx:"<>b;
cout<<"Enter the value of c:"<>c;
//calculations
disc=((pow(b,2))-4*(a*c));
root1=((-b+(sqrt(disc)))/2*a);
root2=((-b-(sqrt(disc)))/2*a);
if(disc==0)
{
cout<<"The roots of the quadratic equation "<0)
{
cout<<"The roots of the quadratic equation "<
*- Write a program to input basic salary of an employee and calculate its Gross salary according to
following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
*. Write a program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and
Computer. Calculate percentage and grade according to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
If you don't find any problem,in this website and if you have a very difficult assignment question that is not present on internet ,then you dont bother yourself,we are here to solve every problem of your life you just click on the Problem asking button and write your problem we slove the code of your problem and sent you on your email addres that you put in the sin up form.