C program sum of two numbers using Extern function

scanfcode.c

#include<stdio.h>
#include<conio.h>
int x,y;
extern void fun(int,int);
void main()
 {          clrscr();
      printf("Enter first number:- ");
      scanf("%d",&x);
      printf("Enter Second number:- ");
      scanf("%d",&y);
	   fun(x,y);
	   getch();
}

program.c

#include"scanfcode.c";
#include<stdio.h>
void fun(int x,int y)
{
 int z=x+y;
printf("Sum of two number = %d",z);
}

OUTPUT:-

sum of two number

Leave a Reply

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