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

What is the difference between the = symbol and == symbol?

1167


What is an operator?

1124


Are global variables static in c?

1212


What is enumerated data type in c?

1125


What does %d do?

1352


What are 3 types of structures?

1103


What is c system32 taskhostw exe?

1070


What is meant by initialization and how we initialize a variable?

1090


What is a MAC Address?

1120


Does c have an equivalent to pascals with statement?

1059


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1253


Explain what math functions are available for integers? For floating point?

1159


What is the process of writing the null pointer?

1057


What is bin sh c?

1095


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

5531