3. Capital of the Country by CodeChum Admin I'm a passionate tourist, touring to a lot of countries in the world. I want to go to the capitals of each of the countries since they say they're usually...





3. Capital of the Country


by CodeChum Admin






I'm a passionate tourist, touring to a lot of countries in the world.



I want to go to the capitals of each of the countries since they say they're usually the best.



Can you help me find where the capital is?




Instructions:



  1. Ask the user for a string input

  2. From the string inputted, find the index of the capital letter.

  3. For this problem, it is guaranteed that there is only 1 capital letter in the inputted string.


  4. Hint: Use the isupper(char) function from the ctype.h library to check if a letter is capital or not.






Input




1. Input string







Output





Enter·string:·Philippines

0



main.c<br>< ><br>+ c<br>5- {<br>char ch;<br>int n;<br>8<br>printf(

Extracted text: main.c <> + c 5- { char ch; int n; 8 printf("Enter string: ");| scanf("%c", &ch); 9. 10 11 if(isupper(ch)) { printf("%d" ,n); } else if(islower(ch)) { printf("%d", n); } 12 13 - 14 15 16 17 18 19 20 else { printf("%d", n); } 21 - 22 23 24 25 return 0; 26 }
tunction from the ctype.h library<br>main.c<br>><br>+ c<br>to check if a letter is capital or<br>not.<br>1 #include <stdio.h><br>2 #include <ctype.h><br>int main()<br>Input<br>1. Input string<br>char ch;<br>int n;<br>printf(

Extracted text: tunction from the ctype.h library main.c > + c to check if a letter is capital or not. 1 #include 2 #include int main() Input 1. Input string char ch; int n; printf("Enter string: "); scanf("%c", &ch); Output 10 11 if(isupper(ch)) { printf("%d",n); } else if(islower(ch)) { printf("%d", n); 12 Enter string: Philippines 13 - 14 15 17 - 18 19 20 else 0 st LO LO N 00 O 23 4 5678 99-의을의맘을 원2
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here