Write a C program that determines if an entered character is

Write a C program that determines if an entered character is a lowercase letter. If the letter is lowercase, determine and print out its position in the alphabet.

Solution


#include <stdio.h>
int main(void) {
   char c;
   printf(\"please enter a charecter:\ \");
   scanf(\"%c\",&c);
   int val=c;
   if(c>=97 && c<=122){
   printf(\"it is lowercase:\");
   printf(\"\ the position in alphabet is:%d\",val);
   }
   else
   printf(\"not a lower case:\");
  
  
   return 0;
}
output:
please enter a charecter:s
it is lowercase:
the position in alphabet is:115

Write a C program that determines if an entered character is a lowercase letter. If the letter is lowercase, determine and print out its position in the alphabe

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site