-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchcaseproje.c
More file actions
40 lines (29 loc) · 802 Bytes
/
switchcaseproje.c
File metadata and controls
40 lines (29 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main() {
char tip;
int gun,mesafe,ucret;
printf("Gun Giriniz: ");
scanf("%d",&gun);
printf("Mesafe Giriniz: ");
scanf("%d",&mesafe);
printf("Tip Giriniz: ");
scanf("%s",&tip);
switch(tip){
case'R':
case'r':ucret=gun*20+mesafe*18;
printf("Ucretiniz :%d",ucret);break;
case'M':
case'm':ucret=gun*32+mesafe*22;
printf("Ucretiniz :%d",ucret);break;
case'H':
case'h':ucret=gun*51+mesafe*36;
printf("Ucretiniz :%d",ucret);break;
case'F':
case'f':ucret=gun*20+mesafe*18;
printf("Ucretiniz :%d",ucret);break;
default:printf("Hatali karakter girdiniz");
}
return 0;
}