This works by centering the text across a line....you can modify it to move to the center of the screen vertically too...
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define TEXT_WIDTH 80
void centre(char[], int);
int main(void)
{
char text[81];
puts("Please enter a phrase:");
gets(text);
centre(text, TEXT_WIDTH);
system("pause");
return 0;
}
void centre(char text[], int width)
{
char outtext[1+width];
int n, len, pre;
len = strlen(text);
pre = (width - len) / 2;
for (n=0; n < pre; n++) {
outtext[n] = ' ';
}
outtext[pre] = '\0';
strcat(outtext, text);
for (n=len+pre; n < width; n++) {
outtext[n] = ' ';
}
outtext[width] = '\0';
printf("%s",outtext);
}