Question: I am trying to make a code in C (not C++) that reads in a series of words and prints them out backwards, but makes
I am trying to make a code in C (not C++) that reads in a series of words and prints them out backwards, but makes a new line after a set number of characters. This is my current code. Can someone help. I am lost as how to do this.
#include
int main(void){
int width = 0; int i; int a = 0; int j; int length; char array[30][30]; int block;
printf("Enter the output line length: "); scanf("%d", &width); block = width; printf("Enter your text (control-d to exit)."); scanf("%s", array[a]); while (!feof(stdin)){ a++; scanf("%s", array[a]); }
for (i=a-1; i>=0; i--){ for (j=width-1; j>=0; j--){ length = strlen(array[i]); if (length
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
