Wednesday, 22 January 2014

Function:


A function is a set of statements that perform a specific task in response to a message.
In C language, the functions can be categorized in the following categories:

1. Single-level functions.
2. Multiple-level functions.

     Explain :-


Single-level functions.

#include<stdio.h>
void main()
{
printf(“Hello Dennis Ritchie”);
}

Multiple-level functions.

#include<stdio.h>
void ff()
{
printf(“Hello Dennis Ritchie\n”);
}
void main()
{
printf(“Welcome to C”);
ff();
}

Explane:-

‘void ff()’   -- is a programmer-defined function that can be independently called by ant other function. So, ‘ff()’ function called by ‘main()’ function.
‘\n’            -- is used for place the cursor to the new line.
Therefore the output will be :-

                   Hello Dennis Ritchie

                   Welcome to C

No comments:

Post a Comment

Thanks For Giving Comment In Our Blog.