main()
{
extern int i;
i=20;
printf("%d",sizeof(i));
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
Linker error: undefined symbol '_i'.
Explanation:
extern declaration specifies that the variable i is defined
somewhere else. The compiler passes the external variable to
be resolved by the linker. So compiler doesn't find an
error. During linking the linker searches for the definition
of i. Since it is not found the linker flags an error.
| Is This Answer Correct ? | 22 Yes | 4 No |
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
main() { int a[10]; printf("%d",*a+1-*a+3); }
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
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.
main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above