[Solved] Print ABC – string [closed]


Can you try something like following? I haven’t tested the following but it should work on most part.

// Elvis’s hip and happening ABC-printing code

#include <stdio.h>
#include <string.h>

#define NUM_ABC_LET 26
void makeABC(char abc[NUM_ABC_LET]);

int main()
{
  char abcString[NUM_ABC_LET + 1];
  makeABC(abcString);
  puts(abcString);
  return 0;
}

void makeABC(char abc[NUM_ABC_LET + 1])
{
   char letter;
   int i=0;
   for(letter="a"; letter <= 'z'; letter++)
   {
     abc[i] = letter;
     i++;
   }
   abc[i]='\0';
}

solved Print ABC – string [closed]