November 22, 2024

Wap ‘C’ of categories of function

1. without return type without arguments.

#include<stdio.h>
#include<conio.h>
void add ( );
 main ( )
{
 add (  );               //actual parameter
 getch ( );
 }
void add ( )             //formal parameter
{
int x, y, z;
x = 10;
y = 20;
z = x+y;
printf("%d", Z);
getch( );
}

2. Without return type with arguments.

#include<stdio.h>
#include<conio.h>
void add ( );
 main ( )
{
 add (10,20);               //actual parameter
 getch ( );
 }
void add (int x, int y)             //formal parameter
{
    int x,y,z
    z = x+y;
printf("%d",z);
getch( );
}

Leave a Reply

Your email address will not be published. Required fields are marked *