Question: Write a program my _ ngram.c in C; It will count the number of occurrences per character. My Ngram will take 1 or multiple strings

Write a program my_ngram.c in C; It will count the number of occurrences per character.
My Ngram will take 1or multiple strings as arguments (argv) It will display, one per line: each character, and the numbers of times it appears. No duplicates lines. Order will be alphanumerical.
You can only use printf(3)and write(2).
You can NOT use:
Any functions/syscalls which does not appear in the previous list
Yes, it includes exit
Multiline macros are forbidden
Include another .c is forbidden
Macros with logic (while/if/variables/...) are forbidden
Example outputs:
1:
$>./my_ngram "aaabb" "abc"
a:4
b:3
c:1
$>
2:
$ ./my_ngram "abcdef"
a:1
b:1
c:1
d:1
e:1
f:1
$
3:
$ ./my_ngram
""
:8
$

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!