20 Nisan 2012 Cuma

uygulama-2 cevabı(switch case,while,do while,if-goto,for)

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
main()

{
      char secim,bas;
      int bs,s,f,x,t,c;
      f=x=1;s=t=c=0;
         deneme:
          printf("\nbir sayiyi giriniz=");
          scanf("%d",&bs);
                      printf("\nislem turunu seciniz=");
          secim=getche();
          switch(secim)
          {
          case '!':
               do
          {
               f*=x;
                x++;
                }
                while(x<=bs);
                printf("\n Sonuc=%d",f);
                break;
          case 'i':
               while(s<bs)
               {
                   printf("\nBozok Universitesi");
               s++;
               }
               break;
          case 't':
               for(s=0;s<=bs;s++)
               {if(s%2==1)
               t++;}
               printf("\n Sonuc=%d",t);
          break;
          case 'c':for(s=0;s<=bs;s++)
          {
               if(s%2==0)
               c++;
           }printf("\n Sonuc=%d",c);
               break;
          default:printf("\nhatali giris"); getch(); exit(0);
          }
printf("\nDevam etmek istiyormusun(E/e)'ye basiniz=");
bas=getche();
if(bas=='E'||bas=='e')
goto deneme;
else
exit(1); 
}

Hiç yorum yok:

Yorum Gönder

 https://bunyaminkaya.com/microsoft-sql-server-tum-surumleri-dogrudan-indirme-linkleri-2008-2012-2014-2016/