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 / shams
#include <iostream>
using namespace std;
int main()
{
char n;
cout<<"Enter a character";
cin>>n;
int no=int(n)>=97?int(n)-96:int(n)-64;
cout<<no;
return 0;
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What are the different types of C instructions?
How to write a multi-statement macro?
What is scanf () in c?
Is javascript written in c?
Explain what is the difference between a string and an array?
What is a struct c#?
What is queue in c?
what is ur strangth & weekness
Write program to remove duplicate in an array?
Does c have an equivalent to pascals with statement?
Explain how can you tell whether a program was compiled using c versus c++?
What is an array? What the different types of arrays in c?
Explain the advantages of using macro in c language?
Using which language Test cases are added in .ptu file of RTRT unit testing???
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)