örnek:if(a < b || k > c || d == f|| vs vs..)
         {
            atama kodları .....
         }


 


Date: Wed, 4 Nov 2009 16:13:09 +0200
From: [email protected]
To: [email protected]
Subject: [Linux-programlama] (konu yok)


merhaba iyi günler. aşağıdaki bir programın 3. seçeneği aşağıdaki şekilde 
olacak ama bu çok uzun oldu. bunu daha kısa nasıl yazabilirm?
 
ÇIKTI ÖRNEĞİ:
 

"
Min grade: 45 
You received this grade in Quiz3
 
Max grade: 90
You received this grade in Midterm1
"
 
PROGRAM:
 
if(choice==3)
    {
       max=final;
       min=final;
       
       
       if(max<midterm1)
          max=midterm1;
           
                  
       if(max<midterm2)   
          max=midterm2;
          
       
       if(max<quiz1)
          max=quiz1;
       
       if(max<quiz2)
          max=quiz2;
       
       if(max<quiz3)
          max=quiz3;
    
       printf("\nMax grade:%d\n",max);
       
       if(max==final)
       printf("You received this grade in Final.\n");
       
       if(max==midterm1)
          printf("You received this grade in First Midterm.\n");
           
       if(max==midterm2)
       printf("You received this grade in Second Midterm.\n");
       
       if(max==quiz1)
       printf("You received this grade in First Quiz.\n");
       
       if(max==quiz2)
       printf("You received this grade in Second Quiz.\n");
       
       if(max==quiz3)
       printf("You received this grade in Third Quiz.\n");
    
       if(min>midterm1)
          min=midterm1;
       
       if(min>midterm2)   
          min=midterm2;
       
       if(min>quiz1)
          min=quiz1;
       
       if(min>quiz2)
          min=quiz2;
       
       if(min>quiz3)
          min=quiz3;
    
       printf("\nMin grade:%d\n",min);
       
       if(min==final)
       printf("You received this grade in Final.\n");
       
       if(min==midterm1)
       printf("You received this grade in First Midterm.\n");
       
       if(min==midterm2)
       printf("You received this grade in Second Midterm.\n");
       
       if(min==quiz1)
       printf("You received this grade in First Quiz.\n");
       
       if(min==quiz2)
       printf("You received this grade in Second Quiz.\n");
       
       if(min==quiz3)
       printf("You received this grade in Third Quiz.\n");
       
       
    }
 
teşekkür ederim. iyi günler.                                      
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right from 
Hotmail®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009
_______________________________________________
Linux-programlama mailing list
[email protected]
http://liste.linux.org.tr/mailman/listinfo/linux-programlama

Cevap