C Language Basic

Classification of Programming Language

Programming language can be classified into 2 types

1.                         High Level Language and

2.                         Low Level Language.

High Level Language:- Those are more English like language and hence the programmers found them very easy to learn to convert the programs in high level language to machine language compilers and interpreters are used.

Low Level Language:- All low level language called assembly language is designed in the beginning.  It has some simple instructions.  Those instructions are not binary codes.  But the computer can understand only the machine language.  Hence a converter or translator is developed to translate the low level language programs into machine language.  This translator is known as Assembler.

Translators:- There are three types of translators available for the language.

  1. Assembler
  2. Compiler
  3. Interpreter
  1. Assembler:- This translator is used to convert the programs written in low level language(Assembly) into machine language.
  • Compiler:-  Compiler is used to convert high level language into machine level language.  It checks for error in the entire program and converts the program into machine language.
  • Interpreter:- This is also used to convert high level language into machine language.  It checks for errors statement by statement and converts the statement into machine level language.

There are 256 characters by the micro computer. These values 0 to These can be divided operating system under.
Character type Number of Character

Capital letteres 26 ( A to Z)
Small Letters 26 (a to z)
Digits 10 ( 0 to 9)
Special symbols 32
Control Characters 34
Graphics Characters 128

Out of the 256 character set. First 128 are called ASCII Characters and the next 128 as extended ASCII Characters each ASCII character has a unique appearance.

A to Z 65 to 90
a to z 97 to 122
0 to 9 48 to 57
Enter 13
Space 32
Tab 9
Back Space 8

Algorithm:-A step by step procedure to solve the given problem is known as algorithm.

To find the sum, product, and division of given two numbers.
Steps:–
Read any two numbers a,b
sum=a+b
product=a*b
division=a/b
print sum, product, division
end

To find the maximum value of given two numbers:
Steps:-
Read any two values a,b
max=a
if max<b then max=b
print max
end

To find the maximum value of three numbers
Steps:-
Read any three values a,b,c
max=a
if max<b then max=b a=10 b=20 c=5
if max<c then max=c
print max
end

To check whether the given number is even or odd
Steps:-
Read n
if n%2= = 0,
print “n is even”
else
print “n is odd”
end

To display natural numbers from 1 to given number
Steps:-
Read n
i=1
print i
i=i+1
if i<=n then to to step3
end

To display factors of given numbers
Steps:-
Read n
i=1
if n%i= = 0 then print i
i=i+1
if i<=n then to to step 3
end

To display factorial of given number
Steps:-
Read n
fact=1
fact=fact*n
n=n-1
if n>=1 then go to step3
print fact
end

To display how many digits in given number
Steps:
Read n
nd=0
nd=nd+1
n=n/10
if n>0 then go to step3
print nd
end

To calculate and display sum of given digits in given number
Steps:-
Read n 25
Sum=0
Sum=Sum+(n%10) sum=5+2=7
n=n/10 2/10=0
If n>0 then go to step3
Print sum
end

To check whether the given number is Palindrome or not
Steps:-
Read n 22
rev=0,m=n m=22
rev=rev10+(m%10) 210+(2%10)=22
m=m/10 22/10 =2
if n>0 then go to step3
if n= = rev then print “n is palindrome”
else
“n is not palindrome”
end

Follow Us On