Answer Posted / nimish salve
yes it is possible to define a function inside function.but only in optimized compiler like GCC,DEV C and not in turbo c,visual c++.
try this code
#include<stdio.h>
void fun1(void)//function definition 1
{
printf("Inside fun1\n");
void fun2(void)//function definition for 2nd function
{
printf("Inside fun2\n");
}
fun2();//function call
}
int main()
{
printf("Inside Main\n");
fun1();//function call
return 0;
}
try in both GCC and TurboC and get your answer
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
When should we use pointers in a c program?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
Differentiate between the = symbol and == symbol?
What are the three constants used in c?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is the difference between constant pointer and constant variable?
What is a function simple definition?
What is the best way of making my program efficient?
Is the exit() function same as the return statement? Explain.
p*=(++q)++*--p when p=q=1 while(q<=6)
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
How many header files are in c?
What are the types of pointers in c?
What header files do I need in order to define the standard library functions I use?
What is the size of enum in c?