Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Programming Language The code below can read all the characters but cannot make the cases. #include char toUpper(char c) { c -= 32; return

C Programming Language

image text in transcribed

The code below can read all the characters but cannot make the cases.

#include

char toUpper(char c) { c -= 32; return c; }

int main() { char arr[1100]; int count[26] = {0}; char c; int i = 0; FILE *ptr; ptr = fopen("testdata.txt", "r"); if(ptr == NULL) { printf("Failed to open file. "); return 1; } //int cases = fscanf(ptr, "%d", &cases); // for(int r = 1; r= 'a' && c Jojo loves to give Bibi array of character. Because Bibi loves to make various of sentences, every array of character is divided into a single character. Now after dividing the array of character, Bibi is confuses because there are too many word. Help Bibi by printing the total of each character (Case insensitive Upper Case and Lower Case are treated the same). Format Input The input will consist of several lines contains a lot of numbers in testdata.in file. Input starts with an integer T which indicates the total of testcase. The next T line consists multiple array of character. Multiple array length does not exceed 1000 characters and the characters only contain uppercase and lowercase letter Format Output Output "Case #%d." with 6 line total of each character with some formating (Character in Upper Case : total). Dont forget to print newine after testcase. Please refer the sample output for clarity Constraints Sample Input (testdata.in) Sample Output (standard output) Case #1: ABCDE EGHIJ KIMNO PORST UVWXYZ abedeEghij klnopgrst uvwxyz AaBbCcDdEe FEGgHhIiJ Case #2: Case #3: A :2, B:2, c:2, D2, E2 P:2, G : 2, H :2, 1:2, J:2 K:0, L : 0, M:O,N:0, o:0 Hint A is equal to 0 A'and careful of Space Character

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

More Books

Students also viewed these Databases questions

Question

6. Are my sources reliable?

Answered: 1 week ago

Question

5. Are my sources compelling?

Answered: 1 week ago