little help with a C exercise
hey i am a beginner and really stuck in assignment:
Display the alphabet on the screen, one letter on each line. Next to each letter, each line should also contain an average (obtained through the use of a running total) of all letters displayed in the left-hand column up to that point.
We can only use the running total and a total of 3 Printf statement in the whole program.
The output of program is suppose to look like this :
a a
b a
c b
d b
e c
f c
g d
h d
i e
j e
...until
y m
z m
This is what i have coded so far but i am just confused
Code:
#include <stdio.h>
int main()
{
char columm1 = 0;
char total = 0;
int i = 0
int total = 0
for (i = 0; i < 27; i++)
{
printf("%c, %c /n", columm1, total);
columm1++;
}
return 0;
}
Please help me with what i have done wrong
Thnx