Pages

Wednesday, May 10, 2017

Importing content from other file to c program.



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

Note:

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