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 will be the output for the following main() { printf("hi" "hello"); }
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
What are volatile variables in c?
Where are c variables stored in memory?
How can you pass an array to a function by value?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Ow can I insert or delete a line (or record) in the middle of a file?
What are local variables c?
What is nested structure with example?
Why can arithmetic operations not be performed on void pointers?
Why do we need a structure?
Can we initialize extern variable in c?
what is the basis for selection of arrays or pointers as data structure in a program
How do I determine whether a character is numeric, alphabetic, and so on?
What is static identifier?