I can't even read that, as simple as it is, sorry. The braces are not even consistent in their placement yet alone alignment. Choose a style and use it consistently **always**, and "speed reading" code (seeing the overall structure) becomes much easier; you don't have to gaze intently at every single line and wonder where blocks start and end!
astyle -A1 -p snippet.c
Code:
for(i = 0; i < 26; i++)
{
printf("%d\t", input_c[i]);
}
printf("\n\n");
printf("Percentage of Letter Occurrences:\n");
for(i = 0; i < 26; i++)
{
total = (input_c[i] / 26.0) * 100;
array[i] = total;
printf("%.2f%%\t", total);
}
printf("\n\n");
for(i = 0; i < 26; i++)
{
if(input_c[i] > max)
{
max = input_c[i];
}
else if(input_c[i] < min)
{
min = input_c[i];
}
}
or
astyle -A2 -p snippet.c
Code:
printf("Number of Letter Occurrences:\n");
for(i = 0; i < 26; i++) {
printf("%d\t", input_c[i]);
}
printf("\n\n");
printf("Percentage of Letter Occurrences:\n");
for(i = 0; i < 26; i++) {
total = (input_c[i] / 26.0) * 100;
array[i] = total;
printf("%.2f%%\t", total);
}
printf("\n\n");
for(i = 0; i < 26; i++) {
if(input_c[i] > max) {
max = input_c[i];
} else if(input_c[i] < min) {
min = input_c[i];
}
}
Or whatever you happen to prefer this week. At least make it readable. Please?