CSE 104.1v
CSE 104.1v
Objectives
Required Equipment/Software
Program Code
1)
#include <stdio.h>
int main()
{
float bs, da, hr,gs;
printf("basic salary=");
scanf("%f",&bs);
da=0.4*bs;
hr=0.2*bs;
bs=bs+da+hr;
printf("Dearness allowance=%.1f\nHouse rent allowance=%.1f\nGross
salary=%.1f ",da,hr,bs);
return 0;
}
2)
#include<stdio.h>
int main()
{
float fahrenheit,celsius;
printf("enter temperature in fahrenheit=");
scanf("%f",&fahrenheit);
celsius=(fahrenheit-32)*5/9;
printf("Fahrenheit to Celsius=%f",celsius);
return 0;
}
3)
#include<stdio.h>
#include<math.h>
int main()
{
int length,breadth,radius;
printf("Enter the length of the rectangle= ");
scanf("%d",&length);
printf("Enter the breadth of the rectangle= ");
scanf("%d",&breadth);
printf("Enter the radius of the circle= ");
scanf("%d",&radius);
float area_r,perimeter,area_c,circumference;
area_r=length*breadth;
perimeter=2*(length+breadth);
area_c=3.1416*pow(radius,2);
circumference=2*3.1416*radius;
printf("Rectangle Area: %.1f\n",area_r);
printf("Rectangle Perimeter: %.1f\n",perimeter);
printf("Circle Area: %.1f\n",area_c);
printf("Circle Circumference: %.1f",circumference);
return 0;
}
1)
2)
3)
Conclusion