Skip to content

Commit 468dd28

Browse files
committedJan 20, 2014
Solution to MCA labs
1 parent 22c95eb commit 468dd28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5799
-0
lines changed
 

‎Sem1/C_Programming/01aConvTemp.c

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <stdio.h>
2+
#define FREEZING_PT 32.0f
3+
#define CONV_FACTOR (5.0f/9.0f)
4+
5+
int main(void)
6+
{
7+
float fahrenheit, celsius;
8+
9+
printf("\nEnter temperature in Celsius\n");
10+
scanf("%f",&celsius);
11+
12+
fahrenheit = (celsius/CONV_FACTOR) +FREEZING_PT ;
13+
printf("\nTemperature in Fahrenheit is: %f\n",fahrenheit);
14+
15+
printf("\nEnter temperature in Fahrenheit\n");
16+
scanf("%f",&fahrenheit);
17+
18+
//celsius = (fahrenheit - 32.0f) * (5.0f/9.0f);
19+
celsius = (fahrenheit - FREEZING_PT) * CONV_FACTOR;
20+
printf("\nTemperature in Celsius is: %f\n",celsius);
21+
22+
23+
return 0;
24+
}

‎Sem1/C_Programming/01bEmployee.c

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <stdio.h>
2+
3+
int main(void)
4+
{
5+
float bsc,hra,ta,it,gross,nets;
6+
7+
printf("\nEnter basic salary:");
8+
scanf("%f",&bsc);
9+
10+
hra=.1*bsc;
11+
ta=.05*bsc;
12+
it=.025*bsc;
13+
nets=bsc+hra+ta-it;
14+
15+
printf("\nBasic Salary = %.2f\nHRA = %.2f\nTA = %.2f\nIT = %.2f",bsc,hra,ta,it);
16+
printf("\nNet Salary = %.2f\n",nets);
17+
18+
return 0;
19+
}
20+
21+
22+

0 commit comments

Comments
 (0)
Please sign in to comment.