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 |
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"
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }
main() { char not; not=!2; printf("%d",not); }
Write a function to find the depth of a binary tree.
13 Answers Adobe, Amazon, EFI, Imagination Technologies,
program to find the roots of a quadratic equation
14 Answers College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.
21 Answers ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
main() { extern out; printf("%d", out); } int out=100;