Monday, 2 October 2017

Practical-4

PRACTICAL-4
Aim of the practical:-
Write a program (WAP) to check the input from keyboard is a alphabet or number or a special character.
Header files used:-
#include <iostream.h>
#include <stdlib.h>
Conditional statements/Loops used:-
i.                   If– else –if ladder
Procedures followed:-
The user will be asked to press any key from the keyboard. Then the input will be compared with its range of ASCII values in successive if- else if () statements to identify which particular category it belongs to (alphabets/numbers/special characters).And finally the condition which it will satisfy will be shown as the output.
The details of range of ASCII values are:-
Characters
ASCII values
A… Z (Upper case alphabets)
65 to 90
a… z  (Lower case alphabets)
97 to 122
0…9   (Numbers)
48 to 57

Coding:-

No comments:

Post a Comment