Function Passing no Arguments and Returning no Value

Function Passing no Arguments and Returning no Value, c program for Function Passing no Arguments and Returning no Value

Write a program to demonstrate function passing no arguments and returning no value.

Write a c program for function passing no arguments and returning no value.

C Code, 


#include <stdio.h>
#include <conio.h>

void sum (void);

void main()
{

  sum();

  getch();
}
void sum(void){
  int add, a, b;
  
  printf("Enter two numbers:");
  scanf("%d%d",&a,&b);
  
  add=a+b;
  
  printf("\n the sum is %d",add);
}


Output

Function Passing no Arguments and Returning no Value

You May Also Like...

Subscribe Us