Tuesday 7 December 2010

Functions with no arguments and no return values


Functions with no Arguments and no Return values:

The called Function does not receive any data from the calling Function and it does not return any data back to the calling Function. Hence, there is no data transfer between the calling Function and called Function. So, let us understand this with the help of Program:


#include<stdio.h>
#include<conio.h>
void main()
{
getdata();
}
void getdata()
{
char name[10];
printf(" Enter your name\n");
scanf("%s" , name);
printf(" Your name is %s , name);
}

Output:
Enter your name
Rajendra
Your name is Rajendra

Category of Functions

No comments:

Post a Comment