Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc, char **argv) {
- int a, b; //deklaracja zmiennych
- printf("podaj pierwsza liczbe\n"); //wyswietlenie komunikatu
- scanf("%d", &a); //wprowadzenie zmiennych
- printf("podaj druga liczbe\n");
- scanf("%d", &b);
- printf("a/b ");
- printf("%d", a/b); //wyswietlenie wyniku a/b
- printf("\nb/a ");
- printf("%d", b/a); //wyswietlenie wyniku b/a
- //wyniki sa zawsze takie jakie sie spodziewalem - int nie potrafi przechowywac liczb zmiennoprzecinkowych, dlatego wyswietla niepoprawne wyniki dla wynikow "z reszta"
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement