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 are the various types of control structures in programming?

1006


What is string length in c?

1026


What are the types of arrays in c?

1094


How do you declare a variable that will hold string values?

1104


Explain what is a 'locale'?

1015


what is a constant pointer in C

1094


What is selection sort in c?

1017


Explain how can I convert a number to a string?

1099


Why do we use stdio h and conio h?

1031


Explain goto?

1093


Which one would you prefer - a macro or a function?

1033


In a header file whether functions are declared or defined?

1077


Are global variables static in c?

1108


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

1070


Explain what standard functions are available to manipulate strings?

1024