Write a C Programm..
we press 'a' , it shows the albhabetical number is 1, if we
press 'g' it shows the answer 7.. any can help me
Answer Posted / gourav agrawal
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
char ch;
int no;
printf("Enter the charactor:");
scanf("%c",&ch);
if(int(ch)>=65&&int(ch)<=91)
{
no=int(ch)-64;
printf("%d\n",no);
}
if(int(ch)>=97&&int(ch)<=123)
{
no=int(ch)-96;
printf("%d\n",no);
}
getch();
}
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
How do I get an accurate error status return from system on ms-dos?
What is context in c?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
If you know then define #pragma?
What is storage class?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
What is string concatenation in c?
What are data types in c language?
What was noalias and what ever happened to it?
What is wrong with this statement? Myname = 'robin';
How does placing some code lines between the comment symbol help in debugging the code?
What is the difference between exit() and _exit() function in c?
What is the difference between declaring a variable and defining a variable?
What are the differences between new and malloc in C?
Do pointers store the address of value or the actual value of a variable?