Free latest PlacementPapers, Interview Questions ....  
Invite Your Friends

Go Back   Free latest PlacementPapers, Interview Questions .... > INTERVIEW QUESTIONS ( FRESHERS & EMPLOYEES ) > Programming > C

  
Reply
 
LinkBack Thread Tools
Old 09-12-08, 11:15 AM   #1 (permalink)
Senior Member
 
Join Date: Nov 2008
Posts: 310
Default C language interview questions - Part 3 Receive Free Email Updates

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?


Receive Free Email Updates:: Jobs , Interview Questions, Placement Papers
__________________
Sai
Prepaid Mobile Recharge Online - Airtel, Vodafone, Idea, BSNL Cellone, Reliance Mobile, Tata Indicom.

Last edited by sai6606; 09-12-08 at 11:33 AM.
sai6606 is offline   Reply With Quote
Reply

Bookmarks

Tags
interview, language, part, questions

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT +6.5. The time now is 06:04 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Please Do Not post, copyrighted/internal contents.We are not responsible for any kind of copyrighted material.
If you have objection to any content, please let us know to remove it ASAP.
admin@placementpapers.us