1. HOW TO PRINT "n" in C?
2. how to reverse a sentence
3. Find the binary form
4. what will be the ouput of the following program.,if any error what is it.#includevoid main(){float x=90.5,y=5.0,z;z=x%y;printf("%f",z);}
5. Datatypes Justify Output
6. How can you find the number of elements stored in a static array at a time?
7. What is the output of the following program?#define SQR(x) (x*x)main(){ int a,b=3; a= SQR(b+2); printf("%d",a);}
8. What would be the output of the following program? main() { const int x=5; int *ptrx; ptrx=&x; *ptrx=10; printf("%d",x); }
9. How are pointer variables initialized?
Pointer variable are initialized by one of the
10. what is source code of this tringle A A N I A N I R B A N I R B A N A N I R B A N P A A N I R B A N P A U L 2) A N I R B A N P A 3)
11 Find the output for the following C programmain(){char *ptr = "Ramco Systems";*ptr++;printf("%sn",ptr);ptr++;printf("%s n",ptr);}explain difference between *ptr++ and ptr++
12. Which statement is true? A. Functions are declared in header files B. Functions are defined in header files
13. #includevoid fun(int);void main(){ inta; a=3; fun(a); }void fun(int){ if(n>0) { fun(--n); printf("%d",n); fun(--n); } } What is the output of the above program? Explain.
14. Write a program to print an 2D array in spiral manner
15. 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 ?
16. a=5;c=++a + ++a + ++a;What would be value of c after this statement and how does it come?If we have the codea=5;c=a++ + a++ + a++;What would be the value of c then?
17. If the following program (myprog) is run from the command line as myprog 1
2 3, What would be the output? main(int argc, char *argv[]) { int i,j=0; for(i=0;i
18. Explian Floyd Cycle finding algorithm for circular link list?
19. Write a program to print nos between 100 and 500 which should print nos having 3 different digitsfor eg:it should print :123,159,342 etc all have different digits...but not 121, 122,333, see here atleast 2 digits are equal
20. NCR function
21. const int perplexed = 2;#define perplexed 3main(){ #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed);}
22. printf ("%d" ,printf {"tim") ); 1. results in a syntax error 2. outputs tim 3 3. outputs garbage 4. prints tim and terminates abruptly
23. difference b/w a[i] and i[a]
24. C Program for Combinations
25. Write a program to find distinct word from a file
26. What is heap memory that is used to store global & static variables of C.
27. based on type conversion
28. What is the difference between character array and string in C?
29. String Storing
30. If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output? main(int argc, char *argv[]) { int i; for(i=0;i
31. How size of structure can be calculated? What is byte alignment used while allocating memory for structure members.
32. How can a character and a string with only one character can be differentiated? What is the internal difference between a character and string, with only one character in it?
33. Is it possible to write a c program without semicolons?
34. What are the advantages of auto variables?
35. C Structures
36. What is the advantage of zero filling in calloc() ?
37. What is byte offset of a field within a structure?
38 I want a C program to rearrange a linked list so that nodes with even numbers as their information come first. Input:The input consists of the information in each node of the linked list. Output:The program displays the information in the linked list after the links are rearranged. Sample Input:Enter the information in the linked list (Enter -1 to exit): 321020478-1Sample Output:After links are rearrangedInformation in the linked list:21020483
39. main(){ int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p}
40. How is structure passing and returning implemented?
41. You have a link list. How can you tell whether there is a cycling in it?
42. How many types of sortings are there in C? What are they
43. Can we define an array without any constant expression? If Yes, How?
44. Why is that a pointer is depicted by '*' in C?
45. Write a program in C to find the complex number of a given number.
46. Calendar Program
47. What happens when you overload the stack?
48. C program to count numbers of positive and negative numbers
49. What is a static function?
50. Array is an lvalue or not?
51. what is the significance of following functions1. freopen()2. strtok()3. access()4. state()
52. how to print all the combinations of a given integer
53. C Program for pyramid
54. Write a program in C to find the 3*3 matrix multiplication
55. main(){ if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); }}
56. What is pseudo code ?
57. How many ways a function can be used according to the argument list and return types? Explain
58. what is the "escape hatch" provided by #pragma directive?
59. What is volatile qualifier?
60. What is a qualifier?
61. What is the relation between array name and an element number.
62. What is base address? How is it associated differentiantly for one dimentional and 2 dimentional array?
63. What Ithe difference between a end of line and EOF while giving the inputs during run time?
64. FILE *fp;What is size of FILE data type???
65. The two declarations are different Can you explain where these declarations are applicable effectivelyconst char *s; char const *s;
66. Which area of RAM does static variables get stored?
67. What is a macro, and how do you use it?
68. Can static variables be declared in a header file?
69. Is there any difference between these elements: char *p,char* p,char * p,char*p.
70. What will be the output of the code?#includemain(){int a=10;int b;b=a++ + 20;printf("a= %d b= %d", a, b);}
71. What is an lvalue?
72. Is nesting of conditional operator( ? : ) possible? If no then why? If yes then write down the program to find the greatest of three number?
73. Difference between void pointer and generic pointer?
74. How to execute shell command without using system command in C-langauage? wirte a program execute ls -l and redirect the output to a file, without using system command ?
75. What is a pragma?
76. What does type qualifier volatile indicate to the compiler?
77. What is the difference between structure & union?
78. What is the difference between#include< >and#include" "
79. main(){ char * strA; char * strB = I am OK; memcpy( strA, strB, 6);}
80. Output of this Programme please??main(){ int a[]={2,4,6,8,10}; int i;change(a,5);for(int i=0;i
81. How to write a C program to find the power of 2 in a normal way and in single step?
82. How to write a sizeof function using a macro function?
83. What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
84. All the programs are tested under Turbo C/C++ compilers. It is assumed that, Programs run under DOS environment, The underlying machine is an x86 system, Program is compiled using Turbo C/C++ compiler.The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed). Predict the output or error(s) for the following:i) void main(){ int const * p=5; printf("%d",++(*p));}
85. #include#includevoid main(){static int a[]={0,1,2,3,4};clrscr();int *p[]={a,a+1,a+2,a+3,a+4};printf("n%un%un%d",p,*p,*(*p) );getch();}What will be the output of above program?How?
86. Write the equivalent expression for x%8?
87. What is the difference between typedef & Macros?
88. When should a type cast be used?
89. When is a switch statement better than multiple if statements?
90. When should the register modifier be used? Does it really help?
91. What is difference between && and & similarly || and | i.e., What is difference between logical AND and bit-wise AND?
92. What is the difference between the functions rand(), random(), srand() and randomize()?
93. What is Subscript?
94. why scanf("%d",&n) and gets(string) don't work together?
95. what do you mean by #pragma once
96. can we include a header file in another header file?
97. What is far pointer and where should we use it?
98. How many times fork() function is executed
99. I want C program code for : Reverse the links of a linked list by traversing only once Input:The input consists of the information in each node of the linked list. Output:The program displays the information in the linked list after the links are reversed. Sample Input:Enter the information in the linked list (Enter -1 to exit): 1020304050-1Sample Output:After the links are reversedInformation in the linked list:5040302010
100. What is a sequence point? what is its significance?
101. what do you mean by preprocessor directory
102. What is unabridged list?
103. Write sample code or algorithim to get all possible combinations of data that will be entered from keyboard
104. What is wild pointer?
105. How can I sort things that are too large to bring into memory?
106. viii) main(){ char *p; printf("%d %d ",sizeof(*p),sizeof(p));}
107. Waht is the sample code to print pascals traingle in c
108. How do you redirect a standard stream?
109. What will be the output of the following program in UNIX OS with CC compiler and TC compiler?int main(){ int i=5; printf("\n%d",++i + ++i + ++i + ++i + ++i );} If any difference then Why it is difference?
110. break statement can be simulated by using 1. go to 2. return 3. exit 4. both return and exit
111. the header files used in C programs are usually found in 1. /bin/include 2. /usr/bi
the header files used in C programs are usually found in 1. /bin/include 2. /usr/bin/include 3. /dev/include 4. /usr/ include
112. Given the values of two nodes in a *binary search tree*, write a cprogram to find the lowest common ancestor. You may assume that bothvalues already exist in the tree.The function prototype is as follows:int FindLowestCommonAncestor(node* root,int value1,int value) 20 / 8 22 / 4 12 / 10 14I/P : 4 and 14O/P : 8(Here the common ancestors of 4 and 14, are {8,20}. Of {8,20}, the lowest one is 8).
113. Why don\'t we add null pointer at the end of array of integer?How can we calculate the length of array of integer?
114. struct Foo{ char *pName; char *pAddress;};main(){ struct Foo *obj = malloc(sizeof(struct Foo));clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress);}
115. What is the difference between text and binary modes?
116. Write any small program that will compile in "C" but not in "C++"
117. What is run time? Is there any difference between run time and compile time?
118. What is the return type of the printf and scanf functions ?1) void2) float3) int4) any
119. Can you write and get output for C program without using printf and scanf statements? If Yes, How?
120. What is a void pointer?
2. how to reverse a sentence
3. Find the binary form
4. what will be the ouput of the following program.,if any error what is it.#includevoid main(){float x=90.5,y=5.0,z;z=x%y;printf("%f",z);}
5. Datatypes Justify Output
6. How can you find the number of elements stored in a static array at a time?
7. What is the output of the following program?#define SQR(x) (x*x)main(){ int a,b=3; a= SQR(b+2); printf("%d",a);}
8. What would be the output of the following program? main() { const int x=5; int *ptrx; ptrx=&x; *ptrx=10; printf("%d",x); }
9. How are pointer variables initialized?
Pointer variable are initialized by one of the
10. what is source code of this tringle A A N I A N I R B A N I R B A N A N I R B A N P A A N I R B A N P A U L 2) A N I R B A N P A 3)
11 Find the output for the following C programmain(){char *ptr = "Ramco Systems";*ptr++;printf("%sn",ptr);ptr++;printf("%s n",ptr);}explain difference between *ptr++ and ptr++
12. Which statement is true? A. Functions are declared in header files B. Functions are defined in header files
13. #includevoid fun(int);void main(){ inta; a=3; fun(a); }void fun(int){ if(n>0) { fun(--n); printf("%d",n); fun(--n); } } What is the output of the above program? Explain.
14. Write a program to print an 2D array in spiral manner
15. 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 ?
16. a=5;c=++a + ++a + ++a;What would be value of c after this statement and how does it come?If we have the codea=5;c=a++ + a++ + a++;What would be the value of c then?
17. If the following program (myprog) is run from the command line as myprog 1
2 3, What would be the output? main(int argc, char *argv[]) { int i,j=0; for(i=0;i
18. Explian Floyd Cycle finding algorithm for circular link list?
19. Write a program to print nos between 100 and 500 which should print nos having 3 different digitsfor eg:it should print :123,159,342 etc all have different digits...but not 121, 122,333, see here atleast 2 digits are equal
20. NCR function
21. const int perplexed = 2;#define perplexed 3main(){ #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed);}
22. printf ("%d" ,printf {"tim") ); 1. results in a syntax error 2. outputs tim 3 3. outputs garbage 4. prints tim and terminates abruptly
23. difference b/w a[i] and i[a]
24. C Program for Combinations
25. Write a program to find distinct word from a file
26. What is heap memory that is used to store global & static variables of C.
27. based on type conversion
28. What is the difference between character array and string in C?
29. String Storing
30. If the program (myprog) is run from the command line as myprog 1 2 3 , What would be the output? main(int argc, char *argv[]) { int i; for(i=0;i
31. How size of structure can be calculated? What is byte alignment used while allocating memory for structure members.
32. How can a character and a string with only one character can be differentiated? What is the internal difference between a character and string, with only one character in it?
33. Is it possible to write a c program without semicolons?
34. What are the advantages of auto variables?
35. C Structures
36. What is the advantage of zero filling in calloc() ?
37. What is byte offset of a field within a structure?
38 I want a C program to rearrange a linked list so that nodes with even numbers as their information come first. Input:The input consists of the information in each node of the linked list. Output:The program displays the information in the linked list after the links are rearranged. Sample Input:Enter the information in the linked list (Enter -1 to exit): 321020478-1Sample Output:After links are rearrangedInformation in the linked list:21020483
39. main(){ int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p}
40. How is structure passing and returning implemented?
41. You have a link list. How can you tell whether there is a cycling in it?
42. How many types of sortings are there in C? What are they
43. Can we define an array without any constant expression? If Yes, How?
44. Why is that a pointer is depicted by '*' in C?
45. Write a program in C to find the complex number of a given number.
46. Calendar Program
47. What happens when you overload the stack?
48. C program to count numbers of positive and negative numbers
49. What is a static function?
50. Array is an lvalue or not?
51. what is the significance of following functions1. freopen()2. strtok()3. access()4. state()
52. how to print all the combinations of a given integer
53. C Program for pyramid
54. Write a program in C to find the 3*3 matrix multiplication
55. main(){ if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); }}
56. What is pseudo code ?
57. How many ways a function can be used according to the argument list and return types? Explain
58. what is the "escape hatch" provided by #pragma directive?
59. What is volatile qualifier?
60. What is a qualifier?
61. What is the relation between array name and an element number.
62. What is base address? How is it associated differentiantly for one dimentional and 2 dimentional array?
63. What Ithe difference between a end of line and EOF while giving the inputs during run time?
64. FILE *fp;What is size of FILE data type???
65. The two declarations are different Can you explain where these declarations are applicable effectivelyconst char *s; char const *s;
66. Which area of RAM does static variables get stored?
67. What is a macro, and how do you use it?
68. Can static variables be declared in a header file?
69. Is there any difference between these elements: char *p,char* p,char * p,char*p.
70. What will be the output of the code?#includemain(){int a=10;int b;b=a++ + 20;printf("a= %d b= %d", a, b);}
71. What is an lvalue?
72. Is nesting of conditional operator( ? : ) possible? If no then why? If yes then write down the program to find the greatest of three number?
73. Difference between void pointer and generic pointer?
74. How to execute shell command without using system command in C-langauage? wirte a program execute ls -l and redirect the output to a file, without using system command ?
75. What is a pragma?
76. What does type qualifier volatile indicate to the compiler?
77. What is the difference between structure & union?
78. What is the difference between#include< >and#include" "
79. main(){ char * strA; char * strB = I am OK; memcpy( strA, strB, 6);}
80. Output of this Programme please??main(){ int a[]={2,4,6,8,10}; int i;change(a,5);for(int i=0;i
81. How to write a C program to find the power of 2 in a normal way and in single step?
82. How to write a sizeof function using a macro function?
83. What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
84. All the programs are tested under Turbo C/C++ compilers. It is assumed that, Programs run under DOS environment, The underlying machine is an x86 system, Program is compiled using Turbo C/C++ compiler.The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed). Predict the output or error(s) for the following:i) void main(){ int const * p=5; printf("%d",++(*p));}
85. #include#includevoid main(){static int a[]={0,1,2,3,4};clrscr();int *p[]={a,a+1,a+2,a+3,a+4};printf("n%un%un%d",p,*p,*(*p) );getch();}What will be the output of above program?How?
86. Write the equivalent expression for x%8?
87. What is the difference between typedef & Macros?
88. When should a type cast be used?
89. When is a switch statement better than multiple if statements?
90. When should the register modifier be used? Does it really help?
91. What is difference between && and & similarly || and | i.e., What is difference between logical AND and bit-wise AND?
92. What is the difference between the functions rand(), random(), srand() and randomize()?
93. What is Subscript?
94. why scanf("%d",&n) and gets(string) don't work together?
95. what do you mean by #pragma once
96. can we include a header file in another header file?
97. What is far pointer and where should we use it?
98. How many times fork() function is executed
99. I want C program code for : Reverse the links of a linked list by traversing only once Input:The input consists of the information in each node of the linked list. Output:The program displays the information in the linked list after the links are reversed. Sample Input:Enter the information in the linked list (Enter -1 to exit): 1020304050-1Sample Output:After the links are reversedInformation in the linked list:5040302010
100. What is a sequence point? what is its significance?
101. what do you mean by preprocessor directory
102. What is unabridged list?
103. Write sample code or algorithim to get all possible combinations of data that will be entered from keyboard
104. What is wild pointer?
105. How can I sort things that are too large to bring into memory?
106. viii) main(){ char *p; printf("%d %d ",sizeof(*p),sizeof(p));}
107. Waht is the sample code to print pascals traingle in c
108. How do you redirect a standard stream?
109. What will be the output of the following program in UNIX OS with CC compiler and TC compiler?int main(){ int i=5; printf("\n%d",++i + ++i + ++i + ++i + ++i );} If any difference then Why it is difference?
110. break statement can be simulated by using 1. go to 2. return 3. exit 4. both return and exit
111. the header files used in C programs are usually found in 1. /bin/include 2. /usr/bi
the header files used in C programs are usually found in 1. /bin/include 2. /usr/bin/include 3. /dev/include 4. /usr/ include
112. Given the values of two nodes in a *binary search tree*, write a cprogram to find the lowest common ancestor. You may assume that bothvalues already exist in the tree.The function prototype is as follows:int FindLowestCommonAncestor(node* root,int value1,int value) 20 / 8 22 / 4 12 / 10 14I/P : 4 and 14O/P : 8(Here the common ancestors of 4 and 14, are {8,20}. Of {8,20}, the lowest one is 8).
113. Why don\'t we add null pointer at the end of array of integer?How can we calculate the length of array of integer?
114. struct Foo{ char *pName; char *pAddress;};main(){ struct Foo *obj = malloc(sizeof(struct Foo));clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress);}
115. What is the difference between text and binary modes?
116. Write any small program that will compile in "C" but not in "C++"
117. What is run time? Is there any difference between run time and compile time?
118. What is the return type of the printf and scanf functions ?1) void2) float3) int4) any
119. Can you write and get output for C program without using printf and scanf statements? If Yes, How?
120. What is a void pointer?
No comments:
Post a Comment