Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int a;
- printf("unesi neki broj");
- scanf("%d", &a);
- if(a<0)
- printf("apsolutna vrednost broja %d je %d", a, -a);
- else
- printf("apsolutna vrednost broja %d je %d",a,a);
- int a;
- int desetice, jedinice, stotine, sum=0;
- printf("unesi broj");
- if(a<0)
- printf("%d je negativan",a);
- else { int pom=a;
- jedinice=pom%10;
- pom=/=10
- desetice=pom%10
- pom/=10
- stotine=pom%10
- suma = desetice+jedinice+stotine
- printf("broj %d ima %d stotine %d desetice i %d jedinice", a,stotine,jedinice,desetice);
- printf("suma je %d",suma)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement