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
What is pragma in c?
What is union and structure in c?
Differentiate between null and void pointers.
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
What is the translation phases used in c language?
What is the use of typedef in structure in c?
what is a constant pointer in C
Who is the main contributor in designing the c language after dennis ritchie?
What is an expression?
What is action and transformation in spark?
Is it possible to pass an entire structure to functions?
What are the 5 data types?
What is the difference between int main and void main?
Explain the difference between malloc() and calloc() function?
c program for searching a student details among 10 student details