Tuesday, July 9, 2019

C Programming

C Language



1)     Define C-language.Ans: C-language is a structured programming language that divides program into many functions.
2)     When and who developed C-language?Ans: Dennis Ritchie at Bell telephone laboratory developed C-language in 1972 AD.
3)     Why is C called middle level language?Ans: C is called middle level language because it combines elements of high level language with some features of assembler. A high level language tries to give programmer everything through built-in language. A low level language forces programmer to define function directly from user level.
4)     What are the uses of C-language?Ans: C is mostly used to write system program such as operating system, language, compiler, text editor, language interpreters, utilities, etc.
5)     List the basic data types used in C with their memory consumption.Ans: The basic data types used in C are:
Data Type
Description
Byte
Range
char
Character
1
0-255
int
Integer
2
-33767-32767
float
Single precision
4
6 digits of precision
double
Double precision
8
12 digits of precision
Data Modifiers: Data modifiers change the meaning of the basic data type to fit the various situations. The data modifiers are:

Data Type
Description
Byte
Range
short int
Short integer
2
-33767-32767
unsigned int
Unsigned Integer
2
0 to 65535
long int
Long integer
4
-4294967296 to 4294967295

6)     List the characteristics of C-language.Ans: The characteristics are :
i) It is a high level language with some features of low level language.
ii) It is mostly used to prepare system software.
iii) It is structured programming language with function procedure.
iv) It supports local and global variable.
v) It has only 32 characters.

7)     What are operators? What are the different types of C operator?
Ans: Operators are special symbols that are meant for specific tasks or operators.
The different types of C operators are:-
Arithmetic operators
Assignment operators
Unary operators
Relational operators
Logical operators
Conditional operators

8)     What are urinary operators? State the rules of logical operators.
Ans: The operator that operates on one operand variable or constant is called urinary operator.
The logical operator are:
1) // It connects two expression into one.
2) && operators connects two expression into one. Both expression must be true for the overall   expression must be true for the overall expression to be true
3) ! operator reverses the “true” of an expression

9)     Why is C language popular  than QBASIC?
Ans: Due to the following reasons C language is popular than QBASIC
1)     It is reliable, simple and easy to use
2)     Programs written in care efficient and fast
3)     It occupies less memory space
4)     Programs written in C can be reused

10) What do you mean by source code and object code?
Ans: The instructions written using C language is known as source code.
Thr machine – readable code which is obtained after translation is called object code.

11) What is structured programming ?
Ans: The programming that follows a top- down approach, on which developers separate the overall program structure into different sub selection is called structured programming.

12) Write any two advantages of structured programming ?
Ans: The two advantages of structured programming are:
a)     It is easy to design code and test the program modules independently
b)     It is possible to use a single module in different in different places which reduces program codes.  

13) Write down the features of C- language.
Ans: The features of structured language are:
a)     C is the structured programming language.
b)     C has powerful set of operators.
c)     C is a high level programming language.
d)     C contains very less number of keywords

14) Comparing C and QBASIC languages.
Ans:
QBASIC
C
It is a high level language without feature of low level language.
It is a high level language with some features of low level language.
It is mostly used to design application software.
It is mostly used to prepare system software.
It supports structure programming with sub and function procedure.
It is a structured programming language with function procedure.
It supports local and global variable.
It also supports local and global variable.
IBM PC version of BASIC has around 159 keywords.
It has only 32 keywords.

       
15) What is top-down designing model?
Ans: Dividing a complex task into many small modules into order to perform the task is called top-down design.

16) Mention the advantages of C language.
Ans: Advantages of C language:
a)     Readability
b)     Maintainability
c)     Portability
d)     Reusability

17) What are different types of C language?
Ans: Different types of C language are:
a)     Common C
b)     ANSI C

18) What do you mean by source code and object code?
Ans: The machine readable code written which is obtained after the translation is called object code.
The instructions written using C language C language is known as source code.

19) What are the advantages of C language?
Ans: the advantages of C language are:-
a)     It is machine independent programming language
b)     It is easy to learn and implemented C language
c)     It can be implemented from mobile device to mainframe computers.
d)     It is the mother of all modern programming language like python, pearl 5 and PHP

20) What are the disadvantages of C language?
Ans: The disadvantages of C languages are:-
a)     There is no runtime checking. It has poor errors detection system.
b)     On large programs , it is hard to find errors.
c)     There is no strict type checking int data type to float variables.
d)     It does not support modern programming methodologies oriented programming language.

21) Define counter and accumulator in terms looping.
Ans: A counter is a variable which controls the loop statement and provides the track to run the loop statement in certain number times.
Accumulator is a numeric variable which accumulates the values in a loop statement.

No comments:

Post a Comment