A.C
func()
{
pritnf(" in fuction %d",MACRO);

}


MAIN.c

testfunc()
{
#define MACRO 10
printf("in test function %d", MACRO);
}
main()
{
printf("in main %d",MACRO);
func();
testfunc();
getch();

}

Answers were Sorted based on User's Feedback



A.C func() { pritnf(" in fuction %d",MACRO); } MAIN.c testfunc() { #defi..

Answer / modassir

The error is for the line where we try to call func()
where we try to print macro through printf, as because
macro is not define there.

Is This Answer Correct ?    2 Yes 1 No

A.C func() { pritnf(" in fuction %d",MACRO); } MAIN.c testfunc() { #defi..

Answer / venu

MAIN.c

#define MACRO 10

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);

6 Answers   HCL, Octal, SW,


What is mean by data types in c?

0 Answers  


write a method for an array in which it can display the largest n next largest value.

1 Answers   Value Labs,


extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }

2 Answers  


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

0 Answers  






Is null always defined as 0(zero)?

0 Answers  


Explain how many levels deep can include files be nested?

0 Answers  


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

2 Answers   Ignou,


Linked lists -- can you tell me how to check whether a linked list is circular?

0 Answers  


How do you define CONSTANT in C?

0 Answers   ADP,


Why do we use header files in c?

0 Answers  


What is wrong in this statement?

0 Answers  


Categories