answer :#include<iostream.h>
main( )
{
//declare variable
float sum,minus,num1,num2;
//input1
cout<<''num1='';
cin>>num1;
//input2
cout<<''num2='';
cin>>num2;
//formula
sum=num1+num2;
minus=num2-num1;
//output
cout<<''sum=''<<sum;
cout<<''minus=''<<minus;
return 0;
}
main( )
{
//declare variable
float sum,minus,num1,num2;
//input1
cout<<''num1='';
cin>>num1;
//input2
cout<<''num2='';
cin>>num2;
//formula
sum=num1+num2;
minus=num2-num1;
//output
cout<<''sum=''<<sum;
cout<<''minus=''<<minus;
return 0;
}
Multiply Two Integers
answer :
#include<iostream.h>
main()
{
//Declare variable
int multiply,num1,num2;
//Input num1
cout<<"Enter num1 =";
cin>>num1;
//Input num2
cout<<"Enter Num 2 =";
cin>>num2;
//Formula
multiply=num1*num2;
//Output
cout<<"mutiply= "<<mutiply;
return 0;
}
main()
{
//Declare variable
int multiply,num1,num2;
//Input num1
cout<<"Enter num1 =";
cin>>num1;
//Input num2
cout<<"Enter Num 2 =";
cin>>num2;
//Formula
multiply=num1*num2;
//Output
cout<<"mutiply= "<<mutiply;
return 0;
}
Fahrenheit Convert to Celcius
answer:
#include<iostream.h>
main( )
{
float celcius;
float farenheit;
cout<<"Enter farenheit=";
cin>>farenheit;
celcius=5/9*(farenheit -32);
cout<<"farenheit= "<<farenheit;
cout<<"celcius= "<<celcius;
return 0;
}
main( )
{
float celcius;
float farenheit;
cout<<"Enter farenheit=";
cin>>farenheit;
celcius=5/9*(farenheit -32);
cout<<"farenheit= "<<farenheit;
cout<<"celcius= "<<celcius;
return 0;
}
Celcius Convert to Fahrenheit
answer :
#include<iostream.h>
main()
{
float celcius,farenheit;
cout<< "Enter celcius=";
cin>>celcius;
farenheit=9/5*(celcius+32);
cout<<"Celcius="<<celcius;
cout<<"Farenheit="<<farenheit;
return 0;
}
Divide and Modulus Two Integers
answer:
#include<iostream.h>
main( )
{
//declare variable
float divide, modulus, Num1, Num2;
//Input 1
cout<<"Num1= ";
cin>>Num1;
//Input 2
cout<<"Num2= ";
cin>>Num2 ;
//formula
Divide=Num2/Num1;
Modulus=Num1%Num2;
//Output
cout<<"divide="<<divide;
cout<<"modulus="<<modulus;
return 0;
}
main( )
{
//declare variable
float divide, modulus, Num1, Num2;
//Input 1
cout<<"Num1= ";
cin>>Num1;
//Input 2
cout<<"Num2= ";
cin>>Num2 ;
//formula
Divide=Num2/Num1;
Modulus=Num1%Num2;
//Output
cout<<"divide="<<divide;
cout<<"modulus="<<modulus;
return 0;
}
show the step how to built the coding. Must start from flow chart...
ReplyDelete