Programming

Function Passing No Arguments and Returning no Value

Write a program to functions to passing no arguments an returning no values.

#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

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.