Wednesday, 26 October 2016

WAP to convert temperature Fahrenheit into centigrade.

WAP to convert temperature Fahrenheit into centigrade.

WAP to convert temperature Fahrenheit into centigrade.


//temperature in Fahrenheit into centigrade degree.

#include<stdio.h>
#include<conio.h>
Void main ( )
{
Float f,c;
Clrscr( );
Printf(“\n Enter the temperature in fahrenheit “);
Scanf(“%f”,&f);
C=5.0/9*(f-32);
Printf(“\n %f degree fahrenheit =%f degree centigrade”,f,c);
Getch( );
}

Output.
Enter temperature in Fahrenheit e.g 68.5
68.500000 degree Fahrenheit =20.277779 degree centigrade.





Saturday, 1 October 2016

Program to demonstrate arithmetic operators.

Program to demonstrate arithmetic operators.

Program to demonstrate arithmetic operators.

//To demonstrate arithmetic operators.

#include<iostream.h>
#include<conio.h>
 void main( )
{
int a,b,s,p,d,r,div;
clrscr( );
cout<<"enter the value of a and b";
cin>>a>>b;
s=a+b;
d=a-b;
p=a*b;
div=a/b;
r=a%b;
cout<<"\n addition="<<s;
cout<<"\n subtraction="<<d;
cout<<"\n multiplication="<<p;
cout<<"\n division="<<div;
cout<<"\n remainder="<<r;
getch( );
}

Output.

Enter the value of a and b. e.g 10,3.

Addition = 13.

Subtraction = 7.

Multiplication = 30.

Division = 3.

Remainder = 1.