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
Explain what are the different file extensions involved when programming in c?
Tell us the use of fflush() function in c language?
What is a ternary operator in c?
what are bit fields? What is the use of bit fields in a structure declaration?
Explain about the constants which help in debugging?
What do you mean by keywords in c?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
What are header files and explain what are its uses in c programming?
What are the differences between new and malloc in C?
What is the purpose of clrscr () printf () and getch ()?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
How to throw some light on the b tree?
What is getch c?
What is #include called?
What is the difference between array and linked list in c?