Code in C:
#include <stdio.h>
#include <stdlib.h>
int main()
{
char alfa;
int result=0;
printf("Enter any Alfabet = ");
scanf("%c",&alfa);
result=(int)alfa;
if(result==65||result<91)
{
printf("%c is Capital letter\n",alfa);
}
else if(result==97||result<123)
{
printf("%c is Small letter\n",alfa);
}
return 0;
}
Code in C ++:
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
char value;
int result=0;
cout<<"Enter any alfabet = ";
cin>>value;
result=(int)value;
if(result==65||result<91)
{
cout<<value<<" is Capital letter\n";
}
else if(result==97||result<123)
{
cout<<value<<" is Small letter\n";
}
getch();
}
Output:
0 Questions:
Post a Comment