Can we include one C program into another C program if yes how?

Answers were Sorted based on User's Feedback



Can we include one C program into another C program if yes how?..

Answer / vinay kashyap

may be using the preprocessor directives.. like..

#include "prog1.c"
#include<stdio.h>
int main()
{
.
.
.
.
}

Is This Answer Correct ?    15 Yes 7 No

Can we include one C program into another C program if yes how?..

Answer / dennis richie

@ answer 3:
der can't b multiple declaration of main...

Is This Answer Correct ?    8 Yes 2 No

Can we include one C program into another C program if yes how?..

Answer / krishhna

We can include the another c program so before that the program which you are going to include should be coppied to c:>tc\include directory

Is This Answer Correct ?    2 Yes 0 No

Can we include one C program into another C program if yes how?..

Answer / abhradeep chatterjee

I think its not possible.

Is This Answer Correct ?    12 Yes 12 No

Can we include one C program into another C program if yes how?..

Answer / amegha

can include another file by using preprocessor directive.
#include<program1.c>
#include<stdio.h>
main()
{
-----
-----
}

Is This Answer Correct ?    4 Yes 4 No

Can we include one C program into another C program if yes how?..

Answer / cheers!

You can include a C file in an another file as depicted in the above example.
And you can also include an another process call ( which is basically a program) in a running program like..

int main()
{
main() // example 1
system("./RunMyProg"); // example 2
system("ls -l"); // example 3
}

Is This Answer Correct ?    0 Yes 7 No

Can we include one C program into another C program if yes how?..

Answer / yogesh bansal

Not Sure..But If the below way is correct. then yes, we can
do that

#include <stdio.h>
int main()
{
printf("this is first program\n");
int main()
{
printf("this is second program\n");
return 0;
}
main();
return 0;
}

Is This Answer Correct ?    7 Yes 28 No

Post New Answer

More C Interview Questions

Can math operations be performed on a void pointer?

0 Answers  


Write a code on reverse string and its complexity.

0 Answers   Expedia,


write a program to remove occurrences the word from entered text?

1 Answers  


What is a stream in c programming?

0 Answers  


How can you find the day of the week given the date?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c file management?

28 Answers   3D PLM, Code Studio, Deltech, IBM,


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

0 Answers  


What are the keywords in c?

0 Answers  


What is the Difference between Macro and ordinary definition?

3 Answers   Bosch, Cognizant, College School Exams Tests, Motorola,


two progs are given. one starts counting frm 0 to MAX and the other stars frm MAX to 0. which one executes fast.

5 Answers   Verifone,


What is a union?

0 Answers  


1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

0 Answers  


Categories