Calculate the frequency of characters in a string
Separate logical elements

It's good to separate different logical parts of a program, for example:


Parse input: a function that takes an InputStream and returns a String
Compute frequencies: a function that takes a String and returns frequencies in some form. In your current program you used an int[], it could have been a Map&lt;Character, Integer&gt;.
Print the frequencies: a function that takes the frequencies in some form, returns nothing, and prints to screen the frequencies nicely formatted.


Computing indexes of letters

If the input string contains only uppercase letters, then you can translate those letters to array indexes in the range of 0 to 25 (inclusive) like this:

int index = ch - 'A';


This eliminates the nested loop you had.
It also eliminates the need for the c array.

Initializing arrays

Instead of this:


int[] f = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};



You could write simply int[] f = new int[26];

Instead of this:


char[] c = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};



I would take a lazy approach and write char[] c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();

Use better variable names

Single-letter variable names should only be used for trivial, highly transient things.
The names f and c in the program are inappropriate, and make the program more difficult to read.