Advertisement
Sayukoo

Najwieksza liczba sposrod wypisanych

Oct 8th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int x,liczba=0,duza=0;
  7.  
  8.     printf("Wypisz dowolna ilosc liczb a program wybierze ta najwieksza: ");
  9.     scanf("%d",&x);
  10.         for(int i=0;i<x;i++)
  11.         {
  12.             printf("Liczba %d",i+1);
  13.             printf(": ");
  14.             scanf("%d",&liczba);
  15.  
  16.                 if(liczba>duza) duza=liczba;
  17.  
  18.  
  19.         }
  20.     printf("Sposrod podanych liczb najwieksza jest:  %d",duza);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement