Friday, 29 May 2009

First character of name of any function must be either alphabets or underscore in c




First letter or character of a function's name must be either an alphabet or underscore. If function name start from any digits or any other special character then we will get compilation error.



Example 1:



#include

int main(){

   int min=1,max=100;

   int sum;

   sum= _digit_(min,max);

   printf("sum = %d",sum);

   return 0;

}

int _digit_(int min,int max){

   int total;

Name of function includes only alphabets, digit and underscore in c




A function name in c can  have only alphabet,digits and underscore. If we will use any other characters in the function name then we will get a compilation error.

    

Example:



#include

int main(){

   int min=1,max=100;

   int sum;

   sum=sum ofdigit(min,max);

   printf("sum = %d",sum);

   return 0;

}

int sum of digit(int min,int max){

  int

Sunday, 5 April 2009

Question of c preprocessor with detailed solution

C programming preprocessor
questions and explanations



(1) What will be output of following code?






#include

#define max 10




int main(){




    int i;




    i=++max;




    printf("%d",i);




    return 0;

}






(2) What will be output of
following code?






#include

#define max 10+2




int main(){




    int i;




    i=max*max;




    printf("%d",i);

Saturday, 4 April 2009

c data type tutorial

                   Best tutorials of data type in Programming language
(1)  Good tutorial of data type in c(2)  Data type(3)  Data type part 1       Data type part 2

java tutorial

(1)     Good java tutorial by examples(2)    Java tutorial(3)    Complete Java tutorial

c structure tutorial





          

Best tutorials of Structure in C Programming Language(1)   Structure Tutorial with examples(2)   Structures in C(3)   Structure