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<stdio.h>
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 total;
  total=(min+max)* (max-min+1)/2;
  return total;
}

Output: Compilation error
Explanation: Function name cannot have blank space characters.

Valid name: world, addition23, sum_of_number etc.
Invalid name: factorial#, avg value, display*number etc.

1 comment:

BASANT KUMAR said...

factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.
factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.
factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.