Constants in c:-


1-:decimal
2-:octal
3-:hexadecimal
4-:real constants





write a program that swap two values
#include< stdio.h>
#include< conio.h>
void main()
{
int a,b,c;
clrscr();
a=4;
b=5;
c=a;
a=b;
b=c;
printf("\nthe first number is %d",a);
printf("\nthe first number is %d",b);
getch();
}





working with constants-:
A constant is a value that can never be changed throughout the entire program in c program a constant can be declared by the following two ways

using const keyword -:


syntax-:


const int a=6;

here ,a becomes a constant of integer type having value 6, any change in this value will never be permitted

using # define method

this kind of constant is symbolic constant

syntax -:
#define  a 6

Escape sequences-:
\n-:new line
\t-:tab distance
\a-:audible beep
escape sequences are specific codes that modify the output of simple printf function



control strings -:control strings are special codes used in printf statement especially for identifying the type of variable which is going to be displayed.
following are the major control strings -:

%d-:integer
%ld-:long integer
%u-:unsigned integer
%f-:float
%lf-:long float(double)
%Lf-:long double
%c-:character
%s->string


Comments in c-:

1-:single line
2-:double line(multi line)
Single line-:

void main()
_________
_________
_________
//______________
__________
__________
__________

multi line comment-:

void main()
_________
_________
_________
/*______________*/
_________
_________
_________

types of errors in c-:

1->logical error->these error arise due to a logical mistke however these error is not notified
2->syntatical errors->when we make a mistake related to grammar of C these errors are called syntatical errors
3->run time errors ->these errors arise due to an exception or mathematical contratication.
4->linker errors->when function and keywords fail to relate with their header files these error are called linker errors