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 does struct work in c?
How to get string length of given string in c?
What is type qualifiers?
What is a double c?
What functions are used for dynamic memory allocation in c language?
Write a C program to count the number of email on text
List the variables are used for writing doubly linked list program.
What is New modifiers?
What is maximum size of array in c?
write a program to rearrange the array such way that all even elements should come first and next come odd
Why static variable is used in c?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is a substring in c?
Explain the difference between malloc() and calloc() in c?
Do variables need to be initialized?