C Language: Question Bank

Only available on StudyMode
  • Topic: Variable, Local variable, Global variable
  • Pages : 9 (3020 words )
  • Download(s) : 272
  • Published : November 3, 2011
Open Document
Text Preview
Material from Interview Mantra. Subscribe to free updates via email.

Material from Interview Mantra. Subscribe to free updates via email.

Favourite 50 – C Interview Question Bank
for freshers and experienced IT programmers

Written by Madhulika Reddy and Dhoka Ratan. Edited and Published by Sridhar Jammalamadaka

Get the latest updates and news on topics Career and Education from Interview Mantra – Subscribe to Interview Mantra for free.

ABOUT THIS BOOK
This book comprises of Interview Questions and Answers collected from the famous career advice blog www.InterviewMantra.net The aim of this book is to help freshers and experienced programmers to quickly brush up the basic concepts of C language. This book can be used as a quick study guide before attending a job interview which requires knowledge of C programming language. The questions that appear in this book are few of the most frequently asked questions in IT Job interviews in top MNC companies. All the questions have been neatly answered and have been supported with example code wherever applicable. A lot of effort has been put into this book to make the answers as accurate as possible, but no warranty or fitness is implied. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the programs accompanying it. Please send your feedback to us via email to sridhar@interviewmantra.net

COPYRIGHT INFO
C language – Interview Question Bank by Sridhar Jammalamadaka is licensed under a Creative Commons Attribution-Share Alike 2.5 India License. Based on a work at www.interviewmantra.net. In simple words, you may use this work for commercial purposes, remix the work, reproduce it by any means, provided you keep a link to http://www.interviewmantra.net and attribute the work to the owner - Sridhar Jammalamadaka.

CONTENTS AT A GLANCE
1. 2. 3. 4. 5.
Chapter Name pg-no Variables & Control Flow . . . . . . . . . . . . . . . . . . . . 6 Operators, Constants & Structures . . . . . . . . . . . .11 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29

Material from Interview Mantra. Subscribe to free updates via email.

TABLE OF CONTENTS
CHAPTER 1: Variables & Control Flow 1. What is the difference between declaring a variable and defining a variable? 2. What is a static variable? 3. What is a register variable? 4. Where is an auto variable stored? 5. What is scope & storage allocation of extern and global variables? 6. What is scope & storage allocation of register, static and local variables? 7. What are storage memory, default value, scope and life of Automatic and Register storage class? 8. What are storage memory, default value, scope and life of Static and External storage class? 9. What is the difference between 'break' and 'continue' statements? 10. What is the difference between 'for' and 'while' loops? CHAPTER 2: Operators, Constants & Structures 1. Which bitwise operator is suitable for checking whether a particular bit is ON or OFF? 2. Which bitwise operator is suitable for turning OFF a particular bit in a number? 3. What is equivalent of multiplying an unsigned int by 2: left shift of number by 1 or right shift of number by 1? 4. What is an Enumeration Constant? 5. What is a structure? 6. What are the differences between a structure and a union? 7. What are the advantages of unions? 8. How can typedef be to define a type of structure? 9. Write a program that returns 3 numbers from a function using a structure. 10. In code snippet below: struct Date { int yr; int day; int month; } date1,date2; date1.yr = 2004; date1.day = 4; date1.month = 12; Write a function that assigns values to date2. Arguments to the function must be...
tracking img