Importing content from other file to c program.
#include<stdio.h>
#include "kp.c"
int main()
{
char state_name[20];
p("Enter your state name:");
s("%s",state_name);
p("Your state name is %s", state_name);
return 0;
}
Output of program
Enter your state name:Gujarat
Your state name is Gujarat
kp.c file is stored in the same directory where above program is stored. Content of kp.c file is given below.
#define p printf
#define s scanf
No comments:
Post a Comment