#include <stdio.h>

#define a 10

main()

{

#define a 50

printf("%d",a);

}

Answers were Sorted based on User's Feedback



#include <stdio.h> #define a 10 main() { #define a 50 prin..

Answer / susie

Answer :

50

Explanation:

The preprocessor directives can be redefined
anywhere in the program. So the most recently assigned value
will be taken.

Is This Answer Correct ?    12 Yes 1 No

#include <stdio.h> #define a 10 main() { #define a 50 prin..

Answer / naveen

it will print the most recently processed value .i.e 50
because the preprossed values can be set anywhere in the
program at any time

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Code Interview Questions

Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


What are the files which are automatically opened when a C file is executed?

1 Answers  


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


main() { printf("%d", out); } int out=100;

3 Answers  






What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }

1 Answers  


main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }

1 Answers  


create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"

2 Answers  


how can u draw a rectangle in C

53 Answers   Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,


In a gymnastic competition, scoring is based on the average of all scores given by the judges excluding the maximum and minimum scores. Let the user input the number of judges, after that, input the scores from the judges. Output the average score. Note: In case, more than two judges give the same score and it happens that score is the maximum or minimum then just eliminate two scores. For example, if the number of judges is 5 and all of them give 10 points each. Then the maximum and minimum score is 10. So the computation would be 10+10+10, this time. The output should be 10 because 30/3 is 10.

0 Answers   TCS,


why nlogn is the lower limit of any sort algorithm?

0 Answers  


main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }

1 Answers  


Categories