Advertisement
youuw

zad1 C

Oct 24th, 2021
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char **argv) {
  4.  
  5.     int a, b, c, nw; //deklaracja zmiennych
  6.     printf("podaj pierwsza liczbe\n"); //wyswietlenie komunikatu
  7.     scanf("%d", &a); //wprowadzenie zmiennych
  8.     printf("podaj druga liczbe\n");
  9.     scanf("%d", &b);
  10.     printf("podaj trzecia liczbe\n");
  11.     scanf("%d", &c);
  12.     if(a>b && a>c) nw=a; //logika sprawdzajaca
  13.     else if(b>a && b>c) nw=b;
  14.     else if(c>a && c>b) nw=c;
  15.     else nw=a; //jesli wszystkie sa takie same, to przypisuje pierwsza
  16.    
  17.     printf("najwieksza jest liczba ");
  18.     printf("%d", nw);
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement