-
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
-
Display data in subscript
How can we display data in subscript by using C language?
-
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
-
-
Binary equivalent of Float
How to find binary equivalent of a float number 5.375?
-
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
-
C Program for Combinations
Write a program to generate all combinations of 1,2 and 3 using for loop?
-
Convert 2D Array
1. Given an 2D array A[M][N], we are converting it into A[N][M] along with rotating it anti clockwise. What should be the mapping,A[i][j] = A[?][?] (i,j
are 0 based indices) example:.............................................4......81...2...3...4..............................3......7.......................======>..........2......6 5...6...7...8..............................1......5
2.... -
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.
-
-
-
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 ?
-
-
-
-
Garbage Value
What is garbage value and How it is stored?
-
How are pointer variables initialized?
Pointer variable are initialized by one of the following two waysØ Static memory allocation Ø Dynamic memory allocation
-
-
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
-
C Interview Questions
Ans