C Programming Objectives for Placement (2014)

1. ANSI (American National Standards Institute) is established in 1983. C was invented by Dennis Ritchie and ANSI c standard adopted from 1990 onwards.

2. C is said to be middle-level computer language because it contains best elements of high level and low level languages.

3. C does not check most of the run-time error checking such as array boundaries overrun.

4. C is suitable for System level programming because it allows the direct manipulation of bits, bytes, words and pointers.

5. C contains only 32 keywords (27 from Kernighan & Ritchie and 5 added by ANSI).

6. C is not a block structured language because it does not allow creation of functions within functions. However it can be said to be structured language.

7. The distinguishing feature of a structured language is compartmentalization of code and data. i.e.) Use of local variables in subroutines to ensure no side effects.

8. Examples for non-structured programming languages: FORTRAN, BASIC, COBOL.

9. Examples for structured programming languages: PASCAL, C, C++, ADA.

10. A code block is a logically connected group of program statements that is to be treated as an unit. Such blocks are begin and end with symbols { and }.

11. All keywords are in lower case and main() is not a keyword in c /c++ .

12. The standard library functions in c are in re-locatable format.

13. C language supports separate compilation for multiple programming environment.

14. There are five basic data types in C are int, char, float, double, void. Two more added are bool and wchar_t (some compilers may not support these).

15. Each c/c++ compiler specifies the size and the range of the basic data types in the header file <climits>.

16. There are four data modifiers that can be applied with a data type are signed, unsigned, long, short.

17. The data type int is signed by default whereas char is unsigned by default. The difference between signed and unsigned integers is in the way that the high-order bit is interpreted.

18. Variables declared inside the functions are called as local variables. Variables declared outside of the functions are called as global variables.

19. The keyword auto is used to declare local variables. However the usage of auto is not virtually required.

20. In C language variables must be declared prior to the programming statements but in C++ local variables can be declared at any point within a block structure.

21. A local variable is created when a function is called and is destroyed when a function returns. In general local variables are stored on the stack.

22. The static modifier can be used to retain values of local variables.

23. In C language, there are two access modifiers namely const and volatile.

24. The keyword const is used to protect variables from modification by code. However const variables can be initialized (at the time declaration only).

25. The modifier volatile tells the compiler that a variable value may be changed in ways not explicitly specified by the program.

26. The modifiers const and volatile can be used together to a single variable.

27. There are five storage class specifiers in C language such as extern, static, register, auto saying that how to store the subsequent variable.

28. The specifier extern is used to declare global variable only once and makes them available in multiple programming environment.

29. Static local variable is a local variable that retains its value between function calls. Such variables enable to hide portions of one program from other programs.

30. The register keyword is used to instruct the compiler to keep the value of a variable in a register of the cpu rather than in memory to improve the speed of the operation. Global register variables are not allowed.

31. Register variables do not have addresses it can not be processed by & operator.

32. When more than one register variables are declared then all the register variables could not optimize the speed of the operation. i.e.) compiler can ignore the keyword if required.

33. Global and static local variables are initialized only at the start of the programs. Uninitialized global and static local variables are automatically set to zero.

34. In C literature, ‘lvalue’ refers to variable in LHS and ‘rvalue’ refers to the value of an expression in RHS of the expression.

35. In the assignment statement, the value of an expression in RHS is converted to the data type in LHS.

36. When converting int to char or long int to int the appropriate higher order bits will be removed.

37. When converting char to int or float to double no precision will be added. Only the form of value may change.

38. Multiple assignment statements are used in C to assign the common value to more than one variable.

For example : a = b = c = 8.

39. When /(slash) operator is applied to int or char any remainder will be truncated.

40. The modulus operator % can be used with int to yield the remainder of an integer division. They cannot be applied with float variables.

 

For More : http://www.vidyarthiplus.com/vp/thread-15026.html#.UlVwJtKl5ic