Programming Language
Programming Language
Programming Language
Introduction
C low level language Its just combined and moved about with the arithmetic and logical operators implemented by real machines. There are no operations that manipulate language does not define any storage allocation. No input/output, No Read/write
A Hello C program
In C, the program to print something , we have use printf
#include<stdio.h> main() { printf(hello world\n); }
printf(hello world\n); \n in string is C notation for the newline character Without \n Compiler will show an error
Data types
int integer valude b/w -32768 to +32767 float six significant digits Char - character Short short integer Long long integer Double double precision floating point
Loops
While : check the condition and process Do- while : before checking the condition do the function then check For :
While
Int X=5 Int Y=10 While(x<y) { Printf(x); x=x+1; }
/ condition checks
Do while
Int x=10 Int y=20 Do{ Printf(x); Whie(x>y) } Here , Condition false but the function will process once
For loop
#include<stdio.h> Main() { int x; for (x=0;x<=3;x=x+1) Printf(x); } Output 0123
Symbolic Constants
#define name replacement text
#include<stdio.h> #define x 10 Main() { Printf(x); }
Output 0
/*
*/
For comment , Between /* and */ are ignored by the compiler They may be used freely to make a program easier to understand