Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 1. Napisati program kojim se učitava sa tastature cifra.
- U zavisnosti od vrednosti cifre ispisati 0 – nula, 1 – jedan, 2 – dva...9 – devet.
- */
- #include<stdio.h>
- int main()
- {
- int x;
- printf("Uneti broj 0-9: ");
- scanf("%d",&x);
- if(x>=0 && x<=9)
- switch(x)
- {
- case 0:
- printf("Nula");
- break;
- case 1:
- printf("Jedan");
- break;
- case 2:
- printf("Dva");
- break;
- case 3:
- printf("Tri");
- break;
- case 4:
- printf("Cetiri");
- break;
- case 5:
- printf("Pet");
- break;
- case 6:
- printf("Sest");
- break;
- case 7:
- printf("Sedam");
- break;
- case 8:
- printf("Osam");
- break;
- case 9:
- printf("Devet");
- break;
- }
- else
- printf("Uneti broj nije ispravan.");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement