-
-
-
What would be the output of the following program? main() { const int x=5; int *ptrx; ptrx=&x; *ptrx=10; printf("%d",x); }
A) 5B) 10C) ErrorD) Garbage Value
-
-
How are pointer variables initialized?
Pointer variable are initialized by one of the following two waysØ Static memory allocation Ø Dynamic memory allocation
-
Garbage Value
What is garbage value and How it is stored?
-
-
-
-
printf("Address of j=%un",&j);
printf("Address of k=%un",&k);
return 0;
}
Suppose the answer is:
Address of i=2004
Address of j=2002
Address of k=2000
why is the address decreasing ?">Consider the following program:#includemain(){int i=3;int *j;int **k;j=&i;k=&j;printf("Address of i=%un",&i);printf("Address of j=%un",&j);printf("Address of k=%un",&k);return 0;}Suppose the answer is:Address of i=2004Address of j=2002Address of k=2000why is the address decreasing ?
-
-
-
NCR function
Write a program in C which will print all the possible combination of a given word. E.G. if the word is ABCD then the output should be ABCD, ABDC, ACBD, ACDB, ADBC, ADCB, BACD, BADC, BCAD, BCDA, BDAC, BDCA, CABD, CADB, CBAD, CBDA, CDAB, CDBA, DABC, DACB, DBAC, DBCA, DCAB, DCBA,but the number of letters of the input must not be fixed i.e. the program should run well for any number of letters.
-
C Program for Combinations
Write a program to generate all combinations of 1,2 and 3 using for loop?
-
Write a program to find distinct word from a file
Write a program to find distinct word from file,and to check a particular word present or not in each line
-
-
Explain C Code
#define sro(X) (X*X)main(){int i=3,j,k;j=sro(i++);k=sro(++i);printf("n%d %d",j,k);getch();}output is 9 49can any one explain why we get second output as 49
-
What are the advantages of auto variables?
1)The same auto variable name can be used in different blocks2)There is no side effect by changing the values in the blocks3)The memory is economically used 4)Auto variables have inherent protection because of local scope
-
-
C Interview Questions
Ans