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 / gourav agrawal

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
char ch;
int no;
printf("Enter the charactor:");
scanf("%c",&ch);
if(int(ch)>=65&&int(ch)<=91)
{
no=int(ch)-64;
printf("%d\n",no);
}
if(int(ch)>=97&&int(ch)<=123)
{
no=int(ch)-96;
printf("%d\n",no);
}
getch();
}

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I get an accurate error status return from system on ms-dos?

1133


What is context in c?

930


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

1130


If you know then define #pragma?

1113


What is storage class?

1086


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1991


What is string concatenation in c?

1095


What are data types in c language?

1063


What was noalias and what ever happened to it?

1048


What is wrong with this statement? Myname = 'robin';

1329


How does placing some code lines between the comment symbol help in debugging the code?

1012


What is the difference between exit() and _exit() function in c?

1081


What is the difference between declaring a variable and defining a variable?

1287


What are the differences between new and malloc in C?

1155


Do pointers store the address of value or the actual value of a variable?

1083