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
What are the various types of control structures in programming?
What is string length in c?
What are the types of arrays in c?
How do you declare a variable that will hold string values?
Explain what is a 'locale'?
what is a constant pointer in C
What is selection sort in c?
Explain how can I convert a number to a string?
Why do we use stdio h and conio h?
Explain goto?
Which one would you prefer - a macro or a function?
In a header file whether functions are declared or defined?
Are global variables static in c?
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
Explain what standard functions are available to manipulate strings?