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 / vignesh1988i
#include<stdio.h>
#include<conio.h>
void main()
{
char s;
printf("enter the character :");
scanf("%d",&s);
printf("\n here CAPITAL and SMALL letters are taken as same\n");
if(s>='A'&&s<='Z')
printf("\nthis is the %dth alphabet from first",s-'A');
else if(s>='a'&&s<='z')
printf("\nthis is the %dth alphabet from first",s-'a');
else
printf("\n INVALID ALPHABET");
getch();
}
thank u
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Explain what does it mean when a pointer is used in an if statement?
What is difference between union and structure in c?
What is dynamic memory allocation?
Why c is called a middle level language?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Can you please explain the difference between syntax vs logical error?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
Why we write conio h in c?
what will be the output for the following main() { printf("hi" "hello"); }
What are terms in math?
What is scanf () in c?
Why we use conio h in c?
Why can’t we compare structures?
What is the purpose of clrscr () printf () and getch ()?
in linking some of os executables are linking name some of them