Professional Documents
Culture Documents
#include <iostream.h>
int main()
int number;
cin>>number;
if(number%2==0)
else{
return 0;
Question 2
#include <iostream>
int main()
int number;
cin>>number;
if (number >0){
else{
}
return 0;
******************************************************************************
Question 3
#include <iostream>
int main()
cin>>quantity;
cin>>price;
discount = total*50/100;
else{
return 0;
Question 4
#include <iostream>
int main()
string item;
cout << "Enter the item you buy " << endl;
cin>>item;
cout << "Enter the cost price of the" <<" " <<item << endl;
cin>>costprice;
cout << "Enter the selling price of " <<" "<<item << endl;
cin>>sellingprice;
cout << "The profit you get from " <<item<<"is =" <<" "<<profit <<"Birr" << endl;
else
cout << "The profit you get from"<<" "<<item <<"is =" <<profit <<"Birr"
return 0;
Question 5
#include <iostream>
int main()
cin>>abdi;
cin>>boru;
cin>>oromia;
else{
return 0;
Question 6
#include <iostream>
int main()
cin>> hypotenus;
cin>> adjacent;
cin>> opposite;
if(angle == 180)
return 0;
Question9
#include <iostream>
int main()
int calls;
float bill;
cin>>calls;
bill =200;
bill= 200+(0.6*calls);
bill= 200+(0.6*50)+(0.5*calls);
else{
bill = 200+(0.6*50)+(0.5*50)+(0.4*calls);
return 0;
********************************************************************************
Question10
#include <iostream>
#include<math.h>
int main()
float a,b,c,d,root1,root2;
cin>>a>>b>>c;
d=b*b-4*a*c;
if(d==0){
root1=(-b)/(2*a);
root2 =root1;
else if(d>0){
root1= -(b+sqrt(d))/(2*a);
root2= -(b-sqrt(d))/(2*a);
else{
root1= (-b)/(2*a);
root2 =(-d)/(2*a);
return 0;
Question 11
#include <iostream>
int main()
float mark,percentage;
string subject1,subject2,subject3,subject4,subject5;
cin>>subject1;
cin>> mark;
cin>>subject2;
cin>> mark;
cout << "Enter the 3rd subject " << endl;
cin>>subject3;
cin>> mark;
cin>>subject4;
cin>> mark;
cin>>subject5;
cin>> mark;
percentage = mark *5 / 5;
cout<<"Short summery"<<endl;
cout<<"Short summery"<<endl;
}
else if (percentage >49){
cout<<"Short summery"<<endl;
else{
cout<<"Short summery"<<endl;
return 0;
********************************************************************************
Question 12
#include <iostream>
int main()
char a;
int b;
cin>>a;
cout<<endl;
b= (int)a;
if(a%2==0)
else{
if(b>=33 &&b<=47)
return 0;