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 does struct work in c?

1060


How to get string length of given string in c?

1048


What is type qualifiers?

1117


What is a double c?

965


What functions are used for dynamic memory allocation in c language?

1133


Write a C program to count the number of email on text

1898


List the variables are used for writing doubly linked list program.

2012


What is New modifiers?

1103


What is maximum size of array in c?

1025


write a program to rearrange the array such way that all even elements should come first and next come odd

2262


Why static variable is used in c?

1017


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1078


What is a substring in c?

1022


Explain the difference between malloc() and calloc() in c?

1032


Do variables need to be initialized?

1026