#include <stdio.h>
#include <conio.h>
main()
{
char ch;
clrscr();
printf("\n Enter any character ");
scanf("\n %c",&ch);
if(ch>=65&&ch<=90)
{
printf("\n Character entered is Capital letter");
}
else
{
if(ch>=97&&ch<=122)
{
printf("\n Character entered is small letter");
}
else
{
if(ch>=48&&ch<=57)
{
printf("\n character is digit");
}
else
{
printf("Character is special symbols");
}
}
}
return(0);
}
output:-
enter the any character =50
character is digit
enter the character =120
character is small letter
Welcome ! to C Language Extreme Programmings Blog through learn the programming complete examples.
Write a c program to prints an ascii numbers.
#include <stdio.h>
#include <conio.h>
#define and &&
main()
{
int num=48;
clrscr();
while(num>=48&&num<=60)
{
printf("\n ascii= %d character = %c",num,num);
num++;
}
return(0);
}
output:-
ascii =48 character =0
ascii =49 character =1
ascii =50 character =2
ascii =51 character =3
ascii =52 character =4
ascii =53 character =5
ascii =54 character =6
ascii =55 character =7
ascii =56 character =8
ascii =57 character =9
ascii =58 character = :
ascii =59 character = ;
ascii =60 character = <
#include <conio.h>
#define and &&
main()
{
int num=48;
clrscr();
while(num>=48&&num<=60)
{
printf("\n ascii= %d character = %c",num,num);
num++;
}
return(0);
}
output:-
ascii =48 character =0
ascii =49 character =1
ascii =50 character =2
ascii =51 character =3
ascii =52 character =4
ascii =53 character =5
ascii =54 character =6
ascii =55 character =7
ascii =56 character =8
ascii =57 character =9
ascii =58 character = :
ascii =59 character = ;
ascii =60 character = <
Subscribe to:
Posts (Atom)