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
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 |
int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);
What is mean by data types in c?
write a method for an array in which it can display the largest n next largest value.
extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Is null always defined as 0(zero)?
Explain how many levels deep can include files be nested?
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!+....
Linked lists -- can you tell me how to check whether a linked list is circular?
How do you define CONSTANT in C?
Why do we use header files in c?
What is wrong in this statement?