Question: I have a problem with this code #include #include int main ( ) { char greeting [ 1 0 0 ] ; / / Array
I have a problem with this code #include
#include
int main
char greeting; Array to store the greeting input
int caseNumber ; Initialize the case counter
Infinite loop to process each input line
while
fgetsgreeting sizeofgreeting stdin; Read input line
greetingstrcspngreeting
; Remove newline character
Stop processing if the input is #
if strcmpgreeting#
break;
Compare the greeting and print the corresponding language
if strcmpgreeting "HELLO"
printfCase d: ENGLISH
caseNumber;
else if strcmpgreeting "HOLA"
printfCase d: SPANISH
caseNumber;
else if strcmpgreeting "HALLO"
printfCase d: GERMAN
caseNumber;
else if strcmpgreeting "BONJOUR"
printfCase d: FRENCH
caseNumber;
else if strcmpgreeting "CIAO"
printfCase d: ITALIAN
caseNumber;
else if strcmpgreeting "ZDRAVSTVUJTE"
printfCase d: RUSSIAN
caseNumber;
else
If the greeting doesn't match any known language
printfCase d: UNKNOWN
caseNumber;
caseNumber; Increment case counter for the next greeting
return ;
because all the outputs give Case : "And the respective language." But i need the outputs to be exactly like this Case : ENGLISH
Case : SPANISH
Case : GERMAN
Case : FRENCH
Case : ITALIAN
Case : RUSSIAN
Case : UNKWOWN
how do i modify that code to make it happen, pls help me
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
