Read-only archive. Login and posting are unavailable.
Reply
 
Thread Tools
  #1  
Old 07-07-2010, 13:21
tokochan's Avatar
Senior Member
Join Date: 08-2009
Posts: 862
Các bác xem hộ với, gấp gấp ạ.Lỗi nhỏ nhưng không biết ở đâu

PHP Code:
#include 
#include 

void nhap(int *a);
int sochan(int i,int *a);


void main ()
{
    
int choice,n,sochan;

   do
   {

    
clrscr();
    
printf("#----------- Menu ----------#\n");
    
printf("#---------------------------#\n");
    
printf("1.Nhap so nguyen duong.\n");
    
printf("2.Cac so chan nho hon\n");
    
printf("3.Cac so le nho hon.\n");
    
printf("4.Cac so chinh phuong nho hon.\n");
    
printf("5.Cac so nguyen to nho hon.\n");
    
printf("#---------------------------#\n");
    
printf("6.Thoat\n");

    
printf("Hay nhap lua chon cua ban: ");
    
scanf("%d",&choice);

        switch(
choice)
      {
          case 
1:
             
nhap(&n);
                 break;
         case 
2:
             
sochan(&sochan);
                 break;
         case 
3:

                 break;
         case 
4:

                 break;
         case 
5:

                 break;
         case 
6:

                 break;
         default:
             
printf("Ban da nhap sai, xin vui long nhap lai.");
            
getch();

      }


   }while (
choice !=6);



}
//-----------------------------------------------------------------------------
void nhap (int *a)
{
     
printf("Hay nhap mot so nguyen duong: ");
     
scanf("%d",a);

}
//------------------------------------------------------------------------------
void sochan(int i,int *a)
{
    
printf("Cac so nguyen duong nho hon %d la: ",a);
       for(
i=1;i<*a;i++)
      {
          if(
i%2==0)
          
printf("%d",i);
      }


}
//----------------------------------------------------------------------------} 
Reply With Quote
  #2  
Old 07-07-2010, 13:27
tokochan's Avatar
Senior Member
Join Date: 08-2009
Posts: 862
Re: Các bác xem hộ với, gấp gấp ạ.Lỗi nhỏ nhưng không biết ở đâu

mod xóa hộ em với ạ, lam fđược rồi
Reply With Quote
Reply

« Previous Thread | Next Thread »

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT +7. The time now is 16:15.