Programming in C:
-High level programming language.
-Developed by Dennis Ritchie in 1972 A.D.
Features:
-Simple to learn because it has small set of commands.
-It is structured programming language.
-Modular programming is possible.
-Much faster than BASIC.
-Supports various data types.
-Provides several built-in functions and operators.
-Powerful and flexible.
Differences between C and QBASIC:
-C is more portable than QBASIC.
-C is simpler and easier to develop programs.
#Data types in C:
(i)Integer(int): It stores integers values.
(ii) Characters(char): It stores characters.
(iii) Float: It stores floating values (decimal)
(iv) Double (float): It stores large floating points.
#Range of char variable: 0 to 255
#Range of float: -3.4*10^(-34) to 3.4*10^(-34)
#Range of double: -1.7e^(-308) to 1.7e^(308)
Examples:
(i)int num=5; (num is user defined variable, 5 is value of variable)
(ii) char choice=’p’; (p is initial value given to variable)
(iii) float per=70.77;
(iv) double radii=0.009;
[Note: int, char, float, double are all keywords]
#Differences between QBASIC and C language:
QBASIC | C language |
-It is high level language. | -It is 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 has limited data types. | -It supports wide range of data types. |
-It is interpreter-based programming language. | -It is compiler-based programming language. |