mark willis

mark willis

  • NA
  • 3
  • 0

Display the alphabet on the screen

Sep 20 2008 8:32 AM
Help! i need to t Display the alphabet on the screen, one letter at a time using ASCII. The average should be
displayed in a right-hand column as an integer if the current letter is your first name’s initial
and as a character otherwise.thi is what I have so far.

#include <stdio.h>
int main()
{
int alphaLft;
int runningTotal=0;
int aveRght;
int alphaNum=0;
/* The loop goes while alphaLft =< 122, and alphaLft increases by one every loop*/
for ( alphaLft = 97; alphaLft =< 122; alphaLft++;)
{
alphaNum= alphaNum++;
runningTotal= runningTotal + alphaNum;
aveRght= runningTotal / alphaNum;
}
printf(
"%c, %c", alphaLft,aveRght );

}


Answers (2)