Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the different types of C instructions?

1291


How to write a multi-statement macro?

1031


What is scanf () in c?

1105


Is javascript written in c?

1044


Explain what is the difference between a string and an array?

1151


What is a struct c#?

1032


What is queue in c?

1086


what is ur strangth & weekness

2397


Write program to remove duplicate in an array?

1066


Does c have an equivalent to pascals with statement?

990


Explain how can you tell whether a program was compiled using c versus c++?

1087


What is an array? What the different types of arrays in c?

1154


Explain the advantages of using macro in c language?

983


Using which language Test cases are added in .ptu file of RTRT unit testing???

4262


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)

2103