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 / vaibhav srivastava

#include<stdio.h>
int main()
{
char c;
int i;
printf("Enter any char\t");
scanf("%c",&c);
if ( c>=65 && c<=92)

printf("%d\n",c-64);

else if( c>=97 && c<=122)

printf("%d\n",c-96);
else
printf("\n\nWrong Input\n\n");

}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can i use “int” data type to store the value 32768? Why?

1194


What is the difference between Printf(..) and sprint(...) ?

1550


Can you write the algorithm for Queue?

2128


why wipro wase

2321


What is c language and why we use it?

1079


Can 'this' pointer by used in the constructor?

1101


Is c is a middle level language?

1073


What is scanf_s in c?

1130


How can a string be converted to a number?

1024


What is data structure in c language?

1120


Why is extern used in c?

1099


Explain About fork()?

1124


what is the basis for selection of arrays or pointers as data structure in a program

4318


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

2319


How to write a code for reverse of string without using string functions?

2155