C Language Interview Questions-1


C Language Interview Questions-1

Questions on C Language Introduction as well as Data Types:

1.) What is C Language?
 

•    The C programming linguistic communication is a standardized programming language.
•    It was developed inwards the early on 1970s past times Ken Thompson as well as Dennis Ritchie for exercise on the UNIX operating system.
•    It has since spread to many other operating systems, as well as is i of the almost widely used programming languages.
•    C is prized for its efficiency, as well as is the almost pop programming linguistic communication for writing arrangement software, though it is too used for writing applications.

2.) What is a Programming language?
 

•    Programming linguistic communication is whatever linguistic communication that calculator arrangement tin strength out sympathise straight or indirectly to tin strength out perform the actions asked past times the programmer as laid of instructions inwards course of report of a calculator program.
•    Influenza A virus subtype H5N1 programme is written as a serial of human understandable calculator instructions.
•    The instructions tin strength out endure read past times a compiler as well as linker as well as translated into motorcar code so that a calculator tin strength out sympathise as well as run it.

3.) What is history of C Language?
 

•    C is a programming linguistic communication which born at “AT & T’s Bell Laboratories” of USA inwards 1972.
•    It was written past times “Dennis Ritchie”.
•    This linguistic communication was created for a specific purpose that is to pattern UNIX operating arrangement which is used on many computers.
•    From the start C was intended to endure useful to allow busy programmers to acquire things done because C is such a powerful, dominant as well as supple language, its exercise speedily spread beyond Bell Labs inwards the belatedly 70’s.

4.) What is the purpose of C language?
 

•    In C i tin strength out write programs similar that of high marking languages as inwards COBOL, BASIC, FORTRAN etc. as good as it permits really unopen interaction amongst the inner workings of the computer.
•    It is a full general purpose programming language. It is unremarkably called arrangement programming linguistic communication only as suited to writing a multifariousness of applications.
•    It supports diverse information types
•    It follows the programming mode based on key command stream constructions for structured programming.
•    Functions may endure pre–defined or user defined as well as they may render values of basic types, structures, unions or pointers.

5.) What type of linguistic communication is C?
 

•    C is a full general purpose, structured programming language.
•    Its instructions consist of terms that resemble algebraic expressions, augmented past times English linguistic communication Keywords such as if, else, for, produce as well as while.
•    In this honour C resembles other high-level structured programming languages such as Pascal as well as FORTRAN.
•    C too contains certainly additional features that allow it to endure used at a lower marking hence bridging the gap betwixt motorcar linguistic communication as well as the to a greater extent than conventional high-level languages.
•    This flexibility allows C to endure used for systems programming (E.g.: writing operating systems) as good as for applications programming.

6.) Why C is called Middle marking language?
 

Middle Level programming languages are closely related to Machine as good as Human being.
•    C programming supports Inline Assembly Language programs.
•    Using inline assembly linguistic communication characteristic inwards C nosotros tin strength out straight access arrangement registers.
•    C programming is used to access retention straight using pointer.
•    C programming too supports high marking linguistic communication features.
•    It is to a greater extent than User friendly as compare to previous languages so C programming is Middle marking language.

7.) Is C Language Case Sensitive Language?
 

Yes … inwards majuscule missive of the alphabet as well as lower missive of the alphabet guide keep dissimilar pregnant inwards c language. So C linguistic communication is a illustration sensitive language.

8.) What are the advantages of C language?
 

•    Easy to write
•    Rich laid of operators as well as functions that are built–in
•    Support for bit–wise operation
•    Flexible exercise of pointers
•    Direct command over the hardware
•    Ability to access BIOS/DOS routines
•    Interacting using Interrupts
•    Ability to write TSR programs
•    Ability to create .COM files
•    Ability to create library files (.LIB)
•    Ability to write interface programs
•    Incorporating assembly linguistic communication inwards C program.

9.) What are the disadvantages of C language?
 

•    There is no runtime checking.
•    There is no strict type checking (for ex: nosotros tin strength out exceed an integer value for the floating information type).
•    As the programme extends it is really hard to prepare the bugs.

10.) What are the steps of executing a C Program?
 

The steps involved inwards executing a C Program are:
•    Creating as well as Editing
•    Compiling
•    Linking   
•    Executing program

Creating as well as Editing: Writing or creating as well as editing a origin programme is a initiative off measuring inwards c language. Source code is written inwards c programming linguistic communication according to the type of work or requirement, inwards whatever text editor.

Compiling: Computer does non sympathise c programming language. It understands alone 0 as well as 1 way motorcar language. So c programming linguistic communication code is converted into motorcar language. The procedure of converting origin code inwards to motorcar code is called compiling.

Linking: There are many built inwards library functions available inwards c programming language. These functions are stored inwards dissimilar header files.

Executing program: Execution is the final step. In this measuring programme starts execution. Its instructions start working as well as output of the programme display on the screen.

11.) What is a compiler?
 

•    Influenza A virus subtype H5N1 calculator programme which reads origin code as well as outputs assembly code or executable code is called a compiler.
•    Influenza A virus subtype H5N1 slice of software that takes third-generation linguistic communication code as well as translates it into a specific assembly code, compilers tin strength out endure a quite complicated slice of software.

Example: C Compiler.

12.) What is an interpreter?
 

•    In computing, an interpreter is a calculator programme that reads the origin code of about other calculator programme as well as executes that program.
•    Because it is interpreted line of piece of work past times line, it is a much slower way of running a programme than i that has been compiled.
•    But is easier for learners because the programme tin strength out endure stopped, modified as well as rerun without time-consuming compiles.

Example: BASIC.

13.) Differences betwixt Source code & Object code?
 

Source code:
Source code is inwards the course of report of a Text as well as is Human Readable. Source code is generated past times Human as well as it is input given to the compiler.

Object code:
Object code is inwards the course of report of Binary numbers as well as it is inwards Machine Readable format. Object code is generated past times the Compiler as well as it is the output of the Compiler.

14.) What is a Data Type?
 

A Data Type is a Type of Data. Data Type is a Data Storage Format that tin strength out incorporate a Specific Type or Range of Values.

When calculator programs shop information inwards variables, each variable must endure assigned a specific information type.
Many people believe that a programmer working inwards C linguistic communication is provided amongst a really tiny laid of information types only Dennis Ritchie has made available to the C programmers a characteristic that allows them to derive their ain information types from the existing one. This way a programmer tin strength out create upwards one's withdraw heed which information type is to endure used depending on these two factors:

•    Economize the retention space.
•    Improve the speed of execution of program.

15.) List the dissimilar Data Types inwards C programming language?
 

In C language, it is compulsory to declare variables amongst their information type earlier using them inwards whatever statement. Mainly information types are categorized into iii categories:

•    Primitive Data Types
•    Derived Data Types
•    User Defined Data Types

16.) What are the Primitive Data Types inwards C language?
 

The primitive information types inwards c linguistic communication are the inbuilt information types provided past times the c linguistic communication itself. Thus, all c compilers furnish back upwards for these information types. The dissimilar primitive information types are,
int
float
double
char
void

17.) Define integer information type?
 

Integer information type is used to shop numeric values without whatever decimal indicate e.g. 7,-101, 107, etc. Influenza A virus subtype H5N1 variable declared as 'int' must incorporate whole numbers e.g. historic menstruum is ever inwards number. Integer occupies two bytes retention infinite as well as its value hit limited to -32768 to +32767.

18.) Define Floating indicate information type?
 

floating indicate information type consists of two types. They are,
•    float
•    double

float:float information type is used to shop numeric values amongst decimal point. In other words, float information type is used to shop existent values, e.g. 3.14, 7.67 etc. Influenza A virus subtype H5N1 variable declared as float must incorporate decimal values e.g. percentage, price, pi, expanse etc. may incorporate existent values. Storage size of float information type is 4. This too varies depend upon the processor inwards the CPU as “int” information type. We tin strength out exercise up-to vi digits after decimal using float information type.The hit for float information type is fromIE-38 to IE+38.

double: double information type too declares variable that tin strength out shop floating indicate numbers only gives precision double than that provided past times float information type. Thus, double information type is too referred to as double precision information type.Double information type is too same as float information type which allows up-to 10 digits after decimal. The hit for double information type is from 1E–37 to 1E+37.

19.) Define graphic symbol information type?
 

char (Character) information type is used to shop unmarried character, inside unmarried quotes e.g. 'a', 'z','e' etc. Influenza A virus subtype H5N1 variable declared as 'char' tin strength out shop alone unmarried graphic symbol e.g. Yes or No alternative requires alone 'y' or 'n' as an answer.

20.) Define void information type?
 

The void type basically way "nothing". Influenza A virus subtype H5N1 void type cannot agree whatever values. You cannot declare a variable to endure a void, only y'all tin strength out declare a variable to endure a pointer to a void. Influenza A virus subtype H5N1 pointer to a void is used when the pointer may indicate to diverse dissimilar types. To exercise the value that a void pointer is pointing to, it must endure cast into about other type.

21.) What are the user defined information types inwards C Language?
 

C Language supports a characteristic where user tin strength out define an identifier that characterizes an existing information type.This User defined information type identifier tin strength out later on endure used to declare variables. In brusk its purpose is to redefine the advert of an existing information type. Different user defined information types are
struct
union
enum
typedef.

22.) Define struct information type?
 

A struct is a user defined information type that stores multiple values of same or dissimilar information types nether a unmarried name. In memory, the entire construction variable is stored inwards sequence.

23.) Define matrimony information type?
 

A matrimony is a user defined information type that stores multiple values of same or dissimilar information types nether a unmarried name. In memory, matrimony variables are stored inwards a mutual retention location.

24.) Define enumerated (enum) information type?
 

An enumeration is a information type similar to a struct or a union. Its members are constants that are written as variables, though they guide keep signed integer values. These constant stand upwards for values that tin strength out endure assigned to corresponding enumeration variables.

25.) Define typedef information type?
 

The 'typedef' allows the user to define novel data-types that are equivalent to existing information types. Once a user defined information type has been established, so novel variables, array, structures, etc. tin strength out endure declared inwards terms of this novel information type.

26.) What are the derived information types inwards C Language?
 

Derived information types are based on key information types, i.e. a derived information types is represented inwards the retention as a key information type.Derived information types don't create a novel information type; instead, they add together about functionality to the basic information types. Two derived information types are - Array & Pointer.

Sumber http://www.gcreddy.com/
Post a Comment (0)
Previous Post Next Post