Showing posts with label interview questions answers. Show all posts
Showing posts with label interview questions answers. Show all posts

Friday, April 27, 2012

C interview basic questions and answers for freshers

Latest collection of interview questions on C for freshers. Find output type c interview question involving string concept.


What is Output of following c snippet?
int main(){
   char *s="Abhas";
   printf("%s",s+ 2); 
   getch();
}
Answer:
has
Explanation: In the above program role of %s is to display the string whose address is passed as an argument. This is how a standard printf statement works in c language. Now since we have passed s + 2 as an argument therefore first value of this expression is evaluated. Here ‘s’ would refer to address of first character in string ‘s’. Now printf would get address of third character (address of first character + 2) as argument so it will display the string starting from third position.  Hence output would be ‘has’.

50 C Interview Questions Answers
Logical C Interview Questions Answers

Find more objective c interview questions answers. Download latest pdf on c interview questions and answers, Test your c skills. 

Free download c interview programs as pdf

Simple C Interview questions and definitions

Read more related posts below.


C interview test Questions and Answer in DOC

Test type subjective logical C interview questions answers




Give two use of bitwise and (&) operator?

It can be used to check whether particular bit is set or not. Eg suppose we have a number 101. Now if we want to check whether its second bit is on or off. To know this we must simply do bitwise and operation on this number with 010. Since result is 0 therefore we can acknowledge that second bit is low in our case.

It can be used to unset particular bit. Eg if you want to unset second LSB of any number then you must simply do bitwise operation between that number and …11111101.




You can see the related posts for more c interview questions answers.

Also you can find some questions mentioned in this website in doc and pdf format uploaded at mediafire.com in one of these related blog post.

C interview interesting questions | C interview Questions Answers


Interesting C interview question inspired from GATE exam.

What is Output of following c snippet?
int main(){
   char *s="Abhas";
   printf("%s",s+s[1]-s[3]); 
   getch();
}

Answer:
bhas

Reason/Solution: In the above program role of %s is to display the string whose address is passed as an argument. This is how a standard printf statement works in c language. Now since we have passed s- s[1]+ s[3] as an argument therefore first value of this expression is evaluated. Here ‘s’ would refer to address of first character in string ‘s’. Since we are subtracting s[1] from s[3] characters at corresponding position (that are ‘a’ and ‘b’) would be subtracted.  On subtracting ‘a’ from ‘b’ (ASCII Value) we get 1 which is added to address of first character in ‘s’ (also referred as ‘s’). Now printf would get address of second character (address of first character + 1) as argument so it will display the string starting from second position.  Hence output is bhas.


Click here to checkout more subjective C Interview question answers


You can see the related posts for more c interview questions answers.

Wednesday, April 18, 2012

C language Interview Questions Answers on basics of C



In this post you can find some very basic C language interview questions. The questions answers in this post are concise and very basic. You can find more detailed and complex c interview questions answers and pdf at

Q) What standard of C language was popular before ANCI C?
A) K&R standard

Q) Who were the two main individuals involved in development of K&R standard for C language?
A) Brian Kernighan and Dennis Ritchie

Q) Is C a compiled language or interpreted language?
A) Compiled language

Q) Why C Programming Language Has Been Named as C?
A) Because it is based on another language called B

Q) What are applications of C programming language?
A) C language is considered ideal language for learning basics of programming to students. Many educational boards have C language as first language taught to computer science students. C language is used for creating computer applications and also used a lot in writing embedded software/firmware for products which use micro-controllers.

You can find more C interview questions and answers in related posts shown below.

Tuesday, April 17, 2012

Best C interview questions and answers PDF download

C Interview Questions with solution 
In this blog you can find lot of good questions for technical c job interviews. I have written several posts on the topic and will keep doing that. You can download a pdf for series of subjective questions at


C Interview Questions Answers PDF

All these questions are available as PDF at:
http://www.mediafire.com/?i5ghxw4mhetp6s1

Click here for common c interview questions asked in companies like Accenture, TCS, CTS, Wipro & Infosys



You can  find more related posts below.


Tuesday, April 10, 2012

Technical interview questions and answers for freshers | C JAVA free download


Technical interview questions and answers for freshers | C JAVA CTS TCS Wipro Cognizant | free download

Number of technical professionals has seen a rapid increase in India. India is slowly becoming software hub of planet. Both number of job and technical professionals have increased in number in recent years. There is demand for websites and blog that provide valuable material for preparing technical interviews.

Some good websites that are store house of valuable technical interview questions are listed below:

TCS Wipro Cognizant technical interview questions


http://www.cwithabhas.com/2013/09/simple-c-interview-questions-for-mass.html

http://placement.freshersworld.com/placement-papers/node/18339

Programming related C Interview questions asked in TCS, Wipro, Cognizant & Accenture

Latest C Interview Questions and answers

Technical interview questions for freshers 

C and JAVA Technical interview questions with answers

Some recommended books for placement preparations :
  • Data Structures and Algorithms Made Easy 
  • Test Your C Skills
  • Any one general aptitude book like Arun Sharma,  RS Agarwal
Important Data Structures topics for placement interviews

  • Linked Lists
  • Stacks
  • Queues
  • Trees
  • Graph
  • Recursion and Backtracking
  • Sorting   
  • Searching   
  • Hashing   
  • String Algorithms
Visit blog home page for more articles on interview preparation.

Monday, April 2, 2012

C Interview questions and Answers | NEW Subjective Interview questions pdf


C Interview Questions Answers


Here are few examples of standard subjective oral questions asked in C interviews. Note how the questions are interrelated and how difficulty of questions increases as interview moves on. A mediocre student will perhaps give up after three or four questions and only those who have clear knowledge of concepts related to C language will make till the last question.

I recommend reading online forums, books like c loops and pitfall and experimentation with your code for clear knowledge of C concepts.


What is a data type?
It is means to identify type of data. When we are storing something in our program then we need to allocate some space for that purpose and while allocating that space we must also specify what kind of data is to be stored in the allocated space. Data types help to solve this problem.

Give example of some data types?
Int, char, float, void etc. are all examples of predefined basic primitive data types. Structures and Unions are user defined data types.

Is it possible to bring about conversion from one data type to other?
Yes, most programming languages provide ways for data to be converted from one data type to other. Data conversion can be both implicit and explicit. Implicit type conversion involves automatic type promotion. Explicit type conversion is also called type casting and may lead to loss in data precision.

What are strings and how can they be represented in c language?
Strings are collection of characters written in particular order. In ‘c’ language they can be implemented by either making array of characters or by making pointer to character data type.

Is there any difference between the two representations?
Often pointers and arrays are considered to be same in case of c language however there is a small difference in both. In case of pointers data is accessed indirectly, so you first retrieve the contents of the pointer, load that as an address (call it "L"), then retrieve its contents. If the pointer has a subscript [i] you instead retrieve the contents of the location 'i' units past "L". They are commonly used for dynamic data structures. In case of arrays Data is accessed directly, so for a[i] you simply retrieve the contents of the location i units past a. They are commonly used for holding a fixed number of elements of the same type of data.

Is it possible to convert strings in c/c++ to corresponding Integer?
atoi() is a predefined function whose prototype is declared in header file stdlib.h. It can be used to convert a string into corresponding integer value by passing the string as an argument in function.

What will happen if some illegal request is made to this function?
Function returns 0 if we try to convert any invalid string to integer. Eg. ‘aaa’ can’t be converted to an integer so atoi(‘aaa’); would return 0.

What will happen if any string in c is converted to integer explicitly?
If we try to convert string into integer explicitly then string’s address will get stored in integer.
int main(){
    char *a="abhas";
    int b=(int)a; // now b will hold address of a
}

C Interview Questions Answers PDF

All these questions are available as PDF at: