C is a programming language developed at AT&T’s Bell Laboratories of USA in 1972.It was designed and written by a man named Dennis Ritchie.
There were many languages discovered before C like BCPL IN 1969,B in 1970 but all were failed in the long run.
Facts about C
• C was invented to write an operating system called UNIX.
• The language was formalized in 1988 by the American National Standard Institute (ANSI).
• Today’s most popular Linux OS and RDBMS MySQL have been written in C.
• Iphone ,Twitter website and most of the antiviruses are also written in C.
• Turbo C++ is a popular compiler for C language.
Features of C
• C is a middle-level programming language.
• C is the mother level of other programming languages.
• C is a case-sensitive language.
• C is a procedure-oriented language.
• C supports top to bottom process.
Uses of C in daily life
• Major parts of operating systems like Windows,UNIX,Linux and Android are written in C.
• Mobile devices like Smartphones and tablets are getting smarter due to programs and operating systems which are builded by C language.
• Most of the 3D computer games are fast just
Because of C which is the builder of most of the gaming frameworks.
Getting Started With C
• Preprocessor-The preprocessor offers several features called preprocessor directives.Each of these begins with a # symbol and are often placed at the beginning of the program.
• Header file-is a library file which contains all the functions.
# include is the preprocessor directive for C and C++,which contains all header files which contains functions.
is a type of header file which means ‘standard input and output’.It contains all the functions like printf ,scanf.
is a type of header file which means ‘console input and output’ .It contains all the functions like getch();clrscr().
‘.h’ is the extension for header files.
Keywords-There are 32 keywords reserved in C language.
‘void’ is a keyword which does not return anything.
main() means startup of a code.
‘printf’ is used to get the output whereas’ scanf’ is used to give the input with respect to a certain function and a symbol of &(ampersand) is used with the variable inside the ‘scanf’ function.
‘comment’ is used to hide the line.
Symbol of comment-‘//’
‘getch()’-is used to identify the function.
– Is used to hold the console screen.
}-‘closure of the source code’
Data type refers to an extensive system used for declaring variables or functions of different types.Data type is used for memory allocation which stores some data.
|Decimal||22.24||float||4 bytes||-3.4*e^10^(-8) to 3.4*e^10(8)||%f|
|Character||‘a’||char||1 byte||-128 to 127||% c|
Some symbols-\t –used for space
\n-used for newline
An operator is a symbol that tells the compiler to perform specific mathematical or logical functions.
Types of operators-
- Arithmetic Operators- +,-,*,/
- Relational Operators- a<b,a>b,a<=b,a>=b,a==b
- Logical Operators-AND, OR, NOT
- Bitwise Operators->> which means if 9>>2;9/2*2=2
<< which means if 2<<0;2*2*0=2
- Assignment Operators-
If a=10 and a=b implies that ‘b’ is assigned to ‘a’(right to left).
Also , a+ =a+b
- Procedure Association-
- Increment or Decrement-
- These are of two types-
Pre increment (or pre decrement) and Post decrement(or post decrement).
C++ Classes in Pune