Computer Science, asked by yoyoyoyo74ywywy, 2 months ago

Write commands for the operation given below based upon the spreadsheet shown below:

A
B
C
D
E
F

1
NAME
BASIC
(Monthly)(Rs.)
HRA
(% of Basic)
DA
(Rs)
Bonus
NET SALARY

2
Suresh
5000
10
450
600


3
Karishma
5600
13
800
600


4
Atul
3500
15
900
400


5
Harmeet
4500
15
500
500


6
Abhay
6000
20
400
700


7
Jyotsana
7500
12
500
700


8
Amit
2500
10
300
700


9
Total salary






10
No. of Emp






(i)To calculate the net salary as sum of Basic, HRA and DA for each employee.​

Attachments:

Answers

Answered by Aryansingh001
3

#include <stdio.h>

int main(){

char wish;

float num1,num2,result;

int flag =1;

printf(" Enter - , + , * ,/ for knowing result \n");

scanf("%c" , &wish);

printf ("Enter number 1\n");

scanf("%f", &num1 );

printf ("Enter number 2\n");

scanf("%f" , &num2 );

switch (wish)

{

case '+':

result =num1+num2;

break ;

case'-':

result =num1-num2;

break ;

case '/':

{

if (num2 ==0)

{

flag = 0;

}

else

{

result =num1/num2;

}

break ;

}

case'*':

result = num1 *num2;

break ;

default : printf ("error");

break ;

}

if (flag ==1)

{

printf ("%f %c %f =%f" , num1, wish,num2 ,result );

}

else

{

printf ("%f %c %f = undefined" ,num1 ,wish ,num2 );

}

}

Similar questions