







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








The C Language is developed for creating system applications that direct interacts to the hardware devices such as drivers, kernals etc. C programming is considered as the base for other programming languages, that is why it is known as mother language. It can be defined by following ways:
To write the first c program, open the C console and write the following code: #include #include void main() { clrscr(); printf("Hello C Language"); getch(); } **#include ** includes the standard input output library functions. The printf() function is defined in stdio.h. **#include ** includes the console input output library functions. The getch() function is defined in conio.h file. void main() The main() function is the entry point of every program in c language. The void keyword specifies that it returns no value. printf() The printf() function is used to print data on the console. clrscr() The clrscr() functionis used to clear the console screen.
Output enter a number: cube of number is: The scanf("%d",&number) statement reads integer number from the console and stores the given value in number variable. The printf("cube of number is:%d ",numbernumbernumber)** statement prints the cube of number on the console.
A variable is a name of memory location. It is used to store data. Its value can be changed and it can be reused many times. It is a way to represent memory location through symbol so that it can be easily identified. Let's see the syntax to declare a variable:
A data type specifies the type of data that a variable can store such as integer, floating, character etc. There are 4 types of data types in C language. Types Data Types Basic Data Type int, char, float, double Derived Data Type array, pointer, structure, union Enumeration Data Type enum Void Data Type void
char 1 byte
A keyword is a reserved word. You cannot use it as a variable name, constant name etc. There are only 32 reserved words (keywords) in C language. A list of 32 keywords in c language is given below: auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
An operator is simply a symbol that is used to perform operations. There can be many types of operations like arithmetic, logical, bitwise etc. There are following types of operators to perform different types of operations in C language.
Bitwise XOR ^ Left to right Bitwise OR | Left to right Logical AND && Left to right Logical OR || Left to right Conditional ?: Right to left Assignment = += - = *= /= %=>>= <<= &= ^= |= Right to left Comma , Left to right