void data type in c

Void is an empty data type that has no value. We use void data type in functions when we don’t want to return any value to the calling function or When used for a function’s parameter list: void specifies that the function takes no parameters.


void sum(int a, int b)


int sum=a+b;



ex 2:

int sum(void)


      int a,b;

      printf(“Enter Two number “);


      return a+b;


Basically void is a keyword to use as a placeholder where you would put a data type, to represent “no data”.

Leave a Comment