Telaryon

Egyszerű példa a for ciklus használatára

Mar 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4.     int szam;
  5.     int oszto;
  6.     int db=0;
  7.  
  8.     printf("\nKerek egy szamot: ");
  9.     scanf("%d", &szam);
  10.     for (oszto=1; oszto<=szam; oszto++) {
  11.         if(szam%oszto==0)
  12.         db++;
  13.     }
  14.     Printf"\nOsztok szama: %d\n", db);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment