Janardhan yadav
C interview questions
2 Answer(s)      2 years ago
Posted in : Java Interview Questions

Plz answer the following questions..... TECHNICAL - C

/question number 1/ Code: int z,x=5,y=-10,a=4,b=2; z = x++ - --y * b / a; What number will z in the sample code above contain? a. 5 b. 6 c. 10 d. 11 e. 12


/question number 2/ With every use of a memory allocation function, what function should be used to release allocated memory which is no longer needed?

a. unalloc() b. dropmem() c. dealloc() d. release() e. free()


/question number 3/ Code: void *ptr; myStruct myArray[10]; ptr = myArray; Which of the following is the correct way to increment the variable "ptr"? a. ptr = ptr + sizeof(myStruct); [Ans] b. ++(int*)ptr; c. ptr = ptr + sizeof(myArray); d. increment(ptr); e. ptr = ptr + sizeof(ptr);


/question number 4/ Code: char* myFunc (char *ptr) { ptr += 3; return (ptr); } int main() { char *x, *y; x = "HELLO"; y = myFunc (x); printf ("y = %s \n", y); return 0; } What will print when the sample code above is executed? a. y = HELLO b. y = ELLO c. y = LLO d. y = LO e. x = O


/question number 5/ Code: struct node nPtr, *sPtr; / pointers for a linked list. */ for (nPtr=sPtr; nPtr; nPtr=nPtr->next) {
free(nPtr); } The sample code above releases memory from a linked list. Which of the choices below accurately describes how it will work?

a. It will work correctly since the for loop covers the entire list. b. It may fail since each node "nPtr" is freed before its next address can be accessed. c. In the for loop, the assignment "nPtr=nPtr->next" should be changed to "nPtr=nPtr.next". d. This is invalid syntax for freeing memory. e. The loop will never end.


/question number 6/ What function will read a specified number of elements from a file?

a. fileread() b. getline() c. readfile() d. fread() e. gets()


/question number 7/ "My salary was increased by 15%!" Select the statement which will EXACTLY reproduce the line of text above. a. printf("\"My salary was increased by 15/%!\"\n"); b. printf("My salary was increased by 15%!\n"); c. printf("My salary was increased by 15'%'!\n"); d. printf("\"My salary was increased by 15%%!\"\n"); e. printf("\"My salary was increased by 15'%'!\"\n");


/question number 8/ What is a difference between a declaration and a definition of a variable?

a. Both can occur multiple times, but a declaration must occur first. b. There is no difference between them. c. A definition occurs once, but a declaration may occur many times. d. A declaration occurs once, but a definition may occur many times. e. Both can occur multiple times, but a definition must occur first.


/question number 9/ int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; What value does testarray[2][1][0] in the sample code above contain? a. 3 b. 5 c. 7 d. 9 e. 11


/question number 10/ Code: int a=10,b; b=a++ + ++a; printf("%d,%d,%d,%d",b,a++,a,++a); what will be the output when following code is executed a. 12,10,11,13 b. 22,10,11,13 c. 22,11,11,11 d. 12,11,11,11 e. 22,13,13,13

View Answers

May 30, 2011 at 3:58 PM


1) 5

2) free()

3)

4) y = LO

5) It may fail since each node "nPtr" is freed before its next address can be accessed.

6) fread()

7) printf("\"My salary was increased by 15%%!\"\n");

8) According to C++, Both can occur multiple times, but a declaration must occur first. According to C, A definition occurs once, but a declaration may occur many times.

9) 11

10) 22,13,13,13


May 30, 2011 at 4:00 PM


1) 5

2) free()

3) By providing function by user can increment that pointer.

4) y = LO

5) It may fail since each node "nPtr" is freed before its next address can be accessed.

6) fread()

7) printf("\"My salary was increased by 15%%!\"\n");

8) According to C++, Both can occur multiple times, but a declaration must occur first. According to C, A definition occurs once, but a declaration may occur many times.

9) 11

10) 22,13,14,14









Related Pages:
C interview questions
C interview questions  Plz answer the following questions..... TECHNICAL - C /question number 1/ Code: int z,x=5,y=-10,a=4,b=2...? a. 5 b. 6 c. 10 d. 11 e. 12 /question number 2/ With every use of a memory
C interview questions
C interview questions  Plz answer the following questions..... TECHNICAL - C /question number 1/ Code: int z,x=5,y=-10,a=4,b=2...? a. 5 b. 6 c. 10 d. 11 e. 12 /question number 2/ With every use of a memory
Difference between C++ and Java - Java Interview Questions
Difference between C++ and Java  Basic difference between C... was derived from C++ but still there is big difference between these two... definition in C++, but there is no closing semicolon. 3. Forward reference
Java - Java Interview Questions
Interview interview, Tech are c++, java,  Hi friend, Now get more information. you can lean all type interview question by following link..., Am Ashok Kumar C from Tamilnadu, I am going to finish Master Degree In Computer
Interview Question - Java Interview Questions
Interview Question  1)If we give S.O.P. statement after finally block shall it prints or not? 2)Write a program in java to read a file & write...(new FileReader("c://a.txt")); Pattern pat = Pattern.compile
Java interview questions
Java interview questions  Plz answer the following questions... - 1 b. -231 to 231 - 1 c. -264 to 264 d. -232 to 232 - 1 Which of the following is not a hexadecimal number? (A) 999 (B) (hex)23 (C) 0x556 (D) 0x1F2
interview questions - Java Interview Questions
interview questions for Java  Hi Any one can u please post the interview point of questions.Warm Regards, Satish
interview - Java Interview Questions
interview  kindly guide me some interview questions of Java
java - Java Interview Questions
Why Java  Why Java? why not C or C
code - Java Interview Questions
code  Will you please tell me the JNI code for shut down button that the code in java from c
java - Java Interview Questions
java  After the declaration: char[] c = new char[100]; what is the value of c[50]? a) 50 b) 49 c) '\u0000' d) '\u0020' e) " " f) cannot... the declaration: int x; the range of x is: a) -231 to 231-1 b) -216 to 216 - 1 c) -232
basic c/c++ questions
basic c/c++ questions  Are the Control statements like if(),while() in built functions? if no, why not as they satisfy all the properties of a function
basic c/c++ questions
basic c/c++ questions  Are the Control statements like if(),while() in built functions? if no, why not as they satisfy all the properties of a function
tomcat - JSP-Interview Questions
file after downloading tomcat server,then put it into C:\\ directory and extract...) CATALINA_HOME = C:\apache-tomcat-6.0.16; 2) CLASS_PATH= C:\apache-tomcat-6.0.16
JAVA - Java Interview Questions
JAVA  WAP TO SOLVE {(a-b)+(c*(d/e%f)} as a=5,b=7,c=9,d=11,e=13,f=15  Hi Friend, Try the following code: class Series{ public static...=a-b; double c2=d/e; double c3=c2%f; double c4=c*c3; double calculate
jsp - JSP-Interview Questions
into C:\ drive.Then go to Start menu->Control Panel->System->Advanced...) CATALINA_HOME = C:\apache-tomcat-5.0; 2) Put the servlet-api.jar into lib folder of apache tomcat folder and set the classpath: CLASS_PATH= C:\apache
java - Java Interview Questions
java  If s1 is declared as: String s1 = "phenobarbital"; What will be the value of s2 after the following line of code: String s2 = s1.substring( 3, 5 ); 1. a) null b) "eno" c) "enoba" d) "no"  
tomcat - JSP-Interview Questions
the tomcat, create a folder 'application' into C:\apache-tomcat-6.0.16... the tomcat, go to C:\apache-tomcat-6.0.16\bin and double click the startup.bat.
Java - Java Interview Questions
Java  How to use C++ code in Java Program?   Hi friend..., typedef, and so forth) to that provided by the C++ preprocessor, but with far... source code is much more consistent and easier to read than C++ source code
corejava - Java Interview Questions
. var c = s.charAt(i); if (((c < "0") || (c > "9"))) return..., append to returnString. for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c
Java - Java Interview Questions
expurgate(Collection c) { for (Iterator i = c.iterator(); i.hasNext.... For Example: static void expurgate(Collection c) { for (Iterator i = c.iterator
java - Java Interview Questions
main( String args ); c) public static void main( String args[] ); d) public... ] inside the main( ) method? a) MyProg b) "I" c) "like" d) 3 e) 4 f) null...? a) array b) boolean c) Integer d) protect e) super 4. After
java - Servlet Interview Questions
explorer.my program is in this directory C:\Tomcat 5.0\webapps\Mimetypes\WEB-INF
java - Java Interview Questions
). So JVM is an Interpreter for bytecode. most modern languages like c....... For the languages like C++, we need to implement full compiler targeted... level languages such as C/C++, its source code require to be compiled
java - Java Interview Questions
java  what is java?  hi , java is a programming language,a development environment,an application environment,a deployment environment. java is similar to c++ syntax(not exactly equal to c++ syntax),using
java - Java Interview Questions
;Servlets are effectively a Java version of CGI scripts, which are written in Perl, C, C++, UNIX shell scripts, etc. There are however, a few important differences
java - Java Interview Questions
row? a) arr[n].length(); b) arr.size; c) arr.size -1; d) arr[n][size]; e
COLLECTIONS - Java Interview Questions
("B"); arraylist.add("C"); arraylist.add("D"); arraylist.add("E
list - Java Interview Questions
arList = new ArrayList(); arList.add("a"); arList.add("b"); arList.add("c
JSP - JSP-Interview Questions
JSP  in my program i have placed a filename label and one text box if i enter any file name such as text files ,documents etc... i will put one search button when i click that search file it will search from our drives like C
Servlets - Servlet Interview Questions
"); FileOutputStream fileOut = new FileOutputStream("c:\\excelFile.xls"); wb.write
OOPS - Java Interview Questions
is = " + i + "."); result = c(i); System.out.println... static int c(int i) throws MyException, MyOtherException { switch (i
Java - Java Interview Questions
to look amateurish and Spartan. * AWT supports Ctrl-C Ctrl-V copy/paste
COLLECTIONS12 - Java Interview Questions
Data(2, "B")); list.add(new Data(3, "C")); list.add(new Data(4, "D")); Map
java - Java Interview Questions
classes in languages like C++ and Pascal. But in Java one can define his/her own
EJB - Java Interview Questions
the previous request and responses. c)Stateful session beans does not have pooling
about c and java
about c and java   i need java and c language interview and objective questions with answers for the fresher.please provide to me   Please...://www.roseindia.net/c-tutorials/ http://www.roseindia.net/interviewquestions
Interview Question - Java Interview Questions
Interview Question  I need Interview Questions on Java,J2EE Pls help me
java - Java Interview Questions
Helpful Java Interview questions   Need Helpful Java Interview questions
Hi - Hibernate Interview Questions
Hi   please send me hibernate interview questions
Struts - Java Interview Questions
Struts Interview Questions  I need Java Struts Interview Questions and examples
About interview questions
About interview questions   I want interview questions on IDE's Please send links
Java Interview Questions
Java Interview Questions  Hi, Can anyone tell the urls of Java Interview Questions on roseindia.net? Thanks
Hibernate - Hibernate Interview Questions
hibernate interview questions and answers  Hi, Can anyone give me the best reference of hibernate interview questions and answers?Thanks in advance
java - Servlet Interview Questions
java  servlet interview questions  Hi friend, For Servlet interview Questions visit to : http://www.roseindia.net/interviewquestions/servlet/ Thanks
java interview - JSP-Interview Questions
java interview  what type of questions would be asked to a 3 years experience person in java? can anyone please provide list of topics or interview questions for 3 years experience in java
java methods - Java Interview Questions
C code into your Java application. The steps to creating native methods are as follows: * Write Java code * Compile Java code * Create C header (.h file) * Create C stubs file * Write C code * Create shared code library (or DLL
help me - Java Interview Questions
interview questions java pdf   Do you have any PDF for Java Interview questions
java class - Java Interview Questions
A { int j; B(int a, int b, int c) { super(a, b); j = a+b+c; } void add() { super.add(); System.out.println("Sum of a, b and c is: " + j); } } class

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.