Quote:

The amount of happiness that you have depends on the amount of freedom you have in your heart

Saturday, 29 October 2011

Addition-subtraction

#include <iostream.h>
// Addition , subtraction and multiplication
int main()
{
    int number1, number2, number3, number4, sum, sub, mul;
    sum=number1+number2-number3*number4;
    cout<<"\n\t Please visit 'cpp-hotseat.blogspot.com' for more examples.\n"<<endl;
    cout<<"\n\t This small program is written by Muhammad Farrukh \n"<<endl;
    cout<<"\t\t\t BS (Computer Science)\n"<<endl;
    cout<<"\t\t\t   6th semester \n\n"<<endl;
    cout<<" \nEnter Number 1:\n"<<endl;
    cin>>number1;
   
    cout<<"\nEnter Number 2: \n"<<endl;
    cin>>number2;
   
    cout<<"\n\nSum is : \n"<<number1+number2<<endl;
   
    cout<<"\nEnter Number 3 : \n"<<endl;
    cin>>number3;
    cout<<"\n\nAns is : \n"<<number1+number2-number3<<endl;
    cout<<"\n\n Thank you for using this prog.\n"<<endl;
   
    cout<<"\nEnter Number 4 : \n"<<endl;
    cin>>number4;
    cout<<" \nAnswer after Multiplication : \n"<<number1+number2-number3*number4<<endl;
   
    cout<<"\n\tMuhammad Farrukh :-) "<<endl;
   
  
   
}   

No comments:

Post a Comment

“You can't change the past, but you can ruin the present by worrying about the future”