C Practical Program Questions

 C Practical Program Questions


---------------×------------------××--------------------×---------------

1. What is Array ?
Ans :- Array is collection of similar types of data. Array stores multiple values with same name.

---------------×------------------××--------------------×---------------

2. What are Advantages of Array ?
Ans :- a. Unlike variable and array can store no.                    of values under single name 
           b. In memory the array element are store                   continuously.
           c. It is easy to add and retrive values into                   the array.
           d. Array is a flexible data structure.

---------------×------------------××--------------------×---------------

3. What are Disadvantages of Array ?
Ans. :- 1. Array store only group of similar type                      of data it can't hold set of different data.
            2. If the array size is big that much                                amount of memory get reserved.
            3. Big size multidimensional array are                          complicated to access and manipulate.
            4. If less element are store then array size                  then it leads to memory wastage.
            5. Static memory allocation.

---------------×------------------××--------------------×---------------

4. Character sets in C 
Ans. :- C language consist of alphabets , Numerics and some special symbols. 

---------------×------------------××--------------------×---------------

5. What are C Tokens ? 
Ans. :- The word from character sets building a blocks of C and sometimes it is known as C Tokens.
 It represents individual entity of language.

---------------×------------------××--------------------×---------------

6. What are types of C Tokens ? 
Ans. There are 6 types of C Tokens. 
  1. String 
  2. Identifier 
  3. Constants
  4. Special Symbols
  5. Operators
  6. Keywords
---------------×------------------××--------------------×---------------

7. What is Keyword ?
Ans. :- Keyword are system defines Identifier and they are reserved words of C Language.
There are 32 keywords in C language.

Some Following Keywords :-
  1. if 
  2. else
  3. int
  4. char 
  5. float
  6. double 
  7. goto 
  8. for 
  9. case 
  10. switch
  11. do
  12. while, etc.
---------------×------------------××--------------------×---------------

8. What are Variables ? 
Ans. :- Variable are user defined identifiers. It is name that represent memory location that can store value.

---------------×------------------××--------------------×---------------

9. Rules for Variable 
Ans. 
  1. Keywords of C cannot be used as variable name.
  2. Should not be start with digit. (0 to 9)
  3. Maximum length is 8 characters.
  4. Must be start with alphabet or underscore (_).
---------------×------------------××--------------------×---------------

10. What are Data types ?
Ans. :- 
  1. Data types are used to variables in Program.
  2. Data type decides the size of variable and type of variable.
---------------×------------------××--------------------×---------------

11. What are types of Data types ? 
Ans. :- 
  1. User defined data types.
  2. Primary data types.
  3. Derived data types.
---------------×------------------××--------------------×---------------

12. Give four example of primary data types.
Ans. 
  1. int 
  2. char
  3. float
  4. double
---------------×------------------××--------------------×---------------

13. State user defined data types.
Ans.
  1. typedef
  2. enum
---------------×------------------××--------------------×---------------

14. State Derived data types.
Ans. 
  1. Array
  2. Structure
  3. Union
---------------×------------------××--------------------×---------------

15. What is data type conversion ?
Ans. :- To convert one Data type to another Data type is known as data type conversion or type casting.

---------------×------------------××--------------------×---------------

16. What are operators ?
Ans. :- Operators are symbols which indicates Operation to be performed.

---------------×------------------××--------------------×---------------

17. What is Algorithm ?
Ans. Theoretical representation of Program is known as algorithm. Program is represented through steps.

---------------×------------------××--------------------×---------------

18. What is Flowchart ?
Ans. The Graphical representation of Program is known as Flowchart.

---------------×------------------××--------------------×---------------

19. Descision Making Statements.
Ans. :- Descision Making Statements are used to take decisions on the basis of a particular condition.

---------------×------------------××--------------------×---------------

20. Conditional Statements.
Ans. :-
 Conditional Statement contains :- 
  1. if statement 
  2. if else statement
  3. Nested if else statement
  4. if else ladder
  5. Logical operator
  6. Relational Operator
  7. switch case statement
---------------×------------------××--------------------×---------------

21. Looping Statements.
Ans. 
  1. for loop statement
  2. while loop statement
  3. do... while loop statement
---------------×------------------××--------------------×---------------

22. Branching statements.
Ans. 
  1. goto statement
  2. break statement
  3. continue statement
---------------×------------------××--------------------×---------------

23. goto statement.
Ans. :- goto is used to transfer program controller from one statement to another statement.

---------------×------------------××--------------------×---------------

24. break statement.
Ans. :- break is used to break the loop. break sends program controller outside the loop.

---------------×------------------××--------------------×---------------

25. continue statement.
Ans. :- continue statement transfers program controller to the beginning of loop.

---------------×------------------××--------------------×---------------

26. What are types of Array ?
Ans. 
  1. One Dimensional Array
  2. Two Dimensional Array
  3. Multi Dimensional Array
---------------×------------------××--------------------×---------------

27. What is string ?
Ans. :- String is collection of characters.

---------------×------------------××--------------------×---------------

28. What is Pointer ?
Ans. :- Pointer is variable which stores memory address of another variable.

---------------×------------------××--------------------×---------------

29. What are types of functions ?
Ans. 
 There are two types of Functions.
  1. pre-defined function.
  2. user defined function.
---------------×------------------××--------------------×---------------

30. Need of Function.
Ans.
  1. Function reduces complexity of program.
  2. Program becomes easy to understand.
  3. Maintain flow in program.
  4. We can use one function again and again.
---------------×------------------××--------------------×---------------

31. What is a structure ?
Ans. :- structure is collection of different types of data.

---------------×------------------××--------------------×---------------

32. What is Local Variable ?
Ans. 
  1. Local variable is declared inside the body of function.
  2. It is also known as internal variable.
  3. We can access in body of function in which it is declared.
  4. We cannot access it in another body of function.
---------------×------------------××--------------------×---------------

33. What is Global Variable ?
Ans. 
  1. Global variable is declared outside the body of function.
  2. Global variable is known as external variable.
  3. We can access the global variable in any body of function.
  4. Global variable is declared above main().
---------------×------------------××--------------------×---------------

Post a Comment

0 Comments