Yeni Yazılar

En Küçük sayı ve en büyük sayıyı veren program etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
En Küçük sayı ve en büyük sayıyı veren program etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

En Küçük sayı ve en büyük sayıyı veren program

En Küçük sayı ve en büyük sayıyı veren program


örnek kod:
#include<stdio.h>
#include<conio.h>
main()   {
int sayi,sayi1,sayi2,sayi3,sayi4,sonuc,max;
printf("Lutfen 5 adet sayi giriniz: \n ");
scanf ("%d %d %d %d %d",&sayi,&sayi1,&sayi2,&sayi3,&sayi4);
sonuc=sayi;
if(sonuc>sayi1)
sonuc=sayi1;
if(sonuc>sayi2)
sonuc=sayi2;
if(sonuc>sayi3)
sonuc=sayi3;
if(sonuc>sayi4)
sonuc=sayi4;
//if(sonuc<sayi4);
printf("En Kucuk Sayi: %d 'dir...",sonuc);
max=sayi;
if(max<sayi1)
max=sayi1;
if(max<sayi2)
max=sayi2;
if(max<sayi3)
max=sayi3;
if(max<sayi4)
max=sayi4;
//if(max<sayi4);
printf("\n En Buyuk Sayi: %d 'dir...",max);
getch();
}
c dilini öğren

En Küçük sayı ve en büyük sayıyı veren program

Posted by Unknown No comments

En Küçük sayı ve en büyük sayıyı veren program


örnek kod:
#include<stdio.h>
#include<conio.h>
main()   {
int sayi,sayi1,sayi2,sayi3,sayi4,sonuc,max;
printf("Lutfen 5 adet sayi giriniz: \n ");
scanf ("%d %d %d %d %d",&sayi,&sayi1,&sayi2,&sayi3,&sayi4);
sonuc=sayi;
if(sonuc>sayi1)
sonuc=sayi1;
if(sonuc>sayi2)
sonuc=sayi2;
if(sonuc>sayi3)
sonuc=sayi3;
if(sonuc>sayi4)
sonuc=sayi4;
//if(sonuc<sayi4);
printf("En Kucuk Sayi: %d 'dir...",sonuc);
max=sayi;
if(max<sayi1)
max=sayi1;
if(max<sayi2)
max=sayi2;
if(max<sayi3)
max=sayi3;
if(max<sayi4)
max=sayi4;
//if(max<sayi4);
printf("\n En Buyuk Sayi: %d 'dir...",max);
getch();
}
c dilini öğren

Blogger tarafından desteklenmektedir.
.
back to top