'Some 'Important 'Theory 'Questions 'On 'C Language....


Q1: Why C is called a Middle Level Language ?
Ans: C combines the features of both Assembly Level Languages(Low Level Languages) and higher Level Languages.For this reason ,C is referred to as a Middle Level Language.The feature of ALLs is that to enabling us to develop system level programs and the features of HLLs are those of Higher degree of readability and machine independence.

Q2: What is the use of a '\0' character ?
Ans: It is referred to as a terminating null character,and is used primarily to show the end of a string value.

Q3: What are reserved words ?
Ans: Reserved words are words that are part of the standard C language library.This means that reserved words having special meaning and therefore cannot be used for purpose other than what it is originally intended for.Examples of reserved words are int,void and return.

Q4: What are the advantages of the C Language ?
Ans: Easy to write
Rich set of operators and functions that are built-in
Support for bit-wise operation
Flexible use of pointers

Q5: What is meant by type casting ?
Ans :It is explicit type conversion required for a number before carrying out processing or assigning to another variable.

Q6: What are Header files and what are its uses in C programming ?
Ans: Header files are known as library files.They contain two essential things:the definition and prototypes of functions being used in a program.Simply put,commands that you use in C programming are actually functions that are defined from within each Header files.Each Header file contains a set of functions.For example:stdio.h is a Header file that contains definition anf prototypes of commands like printf and scanf.

Q7: Can two or more operators such as \n and \t be combined in a single line of program code ?
Ans: Yes it's perfectly valid to combine operators,especially if the need arises.For example:you can have a code like printf("Hello\n\n'World\'") to output the text "Hello" on the first line and "World" enclosed in single quotes to appear on the next two lines.

Q8: What is the modulus operator ?
Ans: The modulus operator outputs the remainder of a divison.It makes use of the percentege (%) symbol.For example 10% 3=1, meaning when you divide 10 by 3,the remainder is 1.

Q9: What is a newline escape sequence ?
Ans: A newline escape sequence is represented by the \n character.This is used to insert a newline when displaying data in the output screen.More spaces can be added by inserting more \ncharacters.For example,\n\n would insert two spaces.A newline escape sequence can be placed before the actual output expression or after.

Q10: What is the advantage of an array over individual variables ?
Ans: When storing multiple related data,it is a good idea to use arrays.This is because arrays are named using only 1 word followed by an element number.For example:to store the 10 different variable names(grade1,grade2,grade3....grade10).With arrays,only 1 name is used,the rest are accessible through the index name(grade[0],grade[1],grade[2]....grade[9]).

Q11: What are the various types of errors ?
Ans: Compile-Time Errors
Linker Errors
Runtime Errors
Logical errors.

Q12: What is the use of a Semicolon(;) at the end of every program statement ?
Ans: It has to do with the parsing process and compilation of the code.A semicolon acts as a delimiter,so that the compiler knows where each statement ends,and can proceed to divide the statement into smaller elements for syntax checking.

Q13: What are C token? List the different types of C tokens ?
Ans: The smallest individual units of a C program are known as tokens
Different types of tokens are:
Constants,Identifiers,Keywords,Operators,Special symbols,Strings.

Q14: What is a function? What are the types of I/O functions ?
Ans: A function is a set of statements to perform a specific task.
I/O functions are grouped into two categories:
Unformatted I/O functions
Formatted functions.

Q15: Is it possible to create your own Header files ?
Ans: Yes,it is possible to create a customised header file.Just include it in the function prototypes that you want to use in your program,and use the #include directive followed by the name of your header file.

Hit Counter
Hit Counter

Welcome To My Page

© ANmol (CSE 4th Semester)


Powered by Blog - Widget
Face Upward - Widget