Thursday, 8 November 2012

ABOUT FUNTION

#include<stdio.h>
void darab(void);
void tolak(int a,float b);
char zzz(void);
//------------------------------------------------------------------------------
int main()
{
    int a;
    float b;
    char kotak;
    a=10;
    b=5.5;
   
    darab();
    tolak(a,b);
    kotak = zzz();
    printf("%c",kotak);
    getchar();
    return (0);
}
//------------------------------------------------------------------------------
void darab(void)//get nothing return nothing
{
     int a, b, c;
     a=2;
     b=2;
     c=a*b;
     printf("total =a*b=%d\n",c);
     
}
//------------------------------------------------------------------------------
void tolak(int a,float b)//get something return nothing
{
     float sum;
     sum=a-b;
     printf("total =a-b=%.2f\n",sum);
     //xpayah letak return (0); sbb dye return nothing
}
//------------------------------------------------------------------------------
char zzz(void)//get nothing return something
{
     return('a');
}

No comments:

Post a Comment