Translate

Friday, 21 March 2014

Source Code :

#include<stdio.h>
#include<conio.h>
void main(void)
{
char a,b;
clrscr();
a=getch();
printf("The character you pressd was: %c",a);
b=a-32;
printf("\nThe character converted is : %c\n\n\n\n\t\t\t\tProgram made by Programer Sami ullah ",b);
getch();
}


We know the code for Capital " A " is 65 and small "a" is 97
so if you take small "a" in terms of code as input and minus 32 from the code that leaves you with 65 the code for capital " A " . so you just print the code in terms of character.
Note [ this can be applied for general ]
the sample program look like this..








No comments:

Post a Comment