pSkpt

C While Döngüsü

Apr 22nd, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. main(){
  3.     int sayi;
  4.    
  5.     printf("Sayi giriniz :");
  6.     scanf("%d",&sayi);
  7.    
  8.     while(sayi != -1){
  9.        
  10.         if (sayi < 1 || sayi > 100){
  11.             printf("Gecersiz Deger Girdiniz!\n");
  12.            
  13.             printf("Sayi giriniz :");
  14.             scanf("%d",&sayi);
  15.         }else{ 
  16.             //islemler
  17.             printf("Girilen Sayi = %d\n",sayi);
  18.            
  19.             printf("Sayi giriniz :");
  20.             scanf("%d",&sayi);
  21.         }
  22.        
  23.     }
  24.    
  25.     getchar();
  26.    
  27. }
Advertisement
Add Comment
Please, Sign In to add comment