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
Which of these functions is safer to use : fgets(), gets()? Why?
What are the advantages and disadvantages of c language?
Can we access the array using a pointer in c language?
Explain data types & how many data types supported by c?
What is the use of printf() and scanf() functions?
write a program in c language to print your bio-data on the screen by using functions.
What is s in c?
What is the difference between memcpy and memmove?
Explain union. What are its advantages?
Explain why can’t constant values be used to define an array’s initial size?
Explain what are the __date__ and __time__ preprocessor commands?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Who invented bcpl language?
Tell me the use of bit field in c language?
What are the application of void data type in c?