Skip to content

Instantly share code, notes, and snippets.

@hasayvaz
Forked from raziyeaydin/switch_case.c
Created May 18, 2012 00:20
Show Gist options
  • Save hasayvaz/2722410 to your computer and use it in GitHub Desktop.
Save hasayvaz/2722410 to your computer and use it in GitHub Desktop.
programlama
#include<stdio.h>
int main(void)
{
float ok_2;;
int ok_1, ok_3, ok_4, sayi = 2413;
ok_1 = sayi/1000;
ok_2 = (int)(sayi/100) % 10;
ok_3 = (sayi/10)%10;
ok_4 = (sayi%10);
switch(ok_1) {
case 1: printf("bin ");
break;
case 2: printf("ikibin ");
break;
case 3: printf("üçbin ");
break;
case 4: printf("dörtbin ");
break;
case 5: printf("beşbin ");
break;
}
switch((int)ok_2) {
case 1: printf("yüz ");
break;
case 2: printf("ikiyüz ");
break;
case 3: printf("üçyüz ");
break;
case 4: printf("dörtyüz ");
break;
case 5: printf("beşyüz ");
break;
}
switch(ok_3) {
case 1: printf("on ");
break;
case 2: printf("yirmi ");
break;
case 3: printf("otuz ");
break;
case 4: printf("kırk ");
break;
case 5: printf("elli ");
break;
}
switch(ok_4) {
case 1: printf("bir\n");
break;
case 2: printf("iki\n");
break;
case 3: printf("üç\n");
break;
case 4: printf("dört\n");
break;
case 5: printf("beş\n");
break;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment