Translate

Bu Blogda Ara

18 Haziran 2016 Cumartesi

En Büyük 2 Sayiyi Bulma

Balçık
Online derleyicilerden kontrol edebilirsiniz


#include <stdio.h>
#include <stdlib.h>
//girilen sayılardan ilk 2 sini bulma
int main() {                int sayac=0,sayi,enb=0,enbb=0;               
                while(sayac!=10){
                              
                               printf("Enter a number man :D");
                               scanf("%d",&sayi);
                              
                               if(enbb!=sayi){
                                               if(enbb<sayi){
                                               enb=enbb;
                                               enbb=sayi;                                       
                               }else if(enb<sayi){
                                              
                                               enb=sayi;
                                                              
                               }
                                              
                               }
                              
                                              
                              
                              
                               sayac++;
                              
                              
                              
                }
                printf("En buyuk sayi:%d\n",enbb);
                printf("En buyuk 2. sayi:%d",enb);
               
               
                return 0;
}

Hiç yorum yok:

Yorum Gönder