Question: I need the code in linux/terminal to be able to print out the following: Please!!! Initial code given: Initial code given: #include #include #include #include
I need the code in linux/terminal to be able to print out the following: Please!!!

Initial code given:
Initial code given:
#include
#include
#include
#include
#include
#include
#define LINESIZE 16
//use one command line argument
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: diagonal
return -1;
}
//create a file so that 16 rows of empty will appear with od -c command
int fd = open("diagonal.out", O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR);
printf("fd = %d ", fd);
char space = ' ';
for(int line=0; line for(int column=0; column write(fd, &space, 1); //0, 17, 34, int n = strlen(argv[1]); for(int i=0; i lseek(fd, (LINESIZE+1)*i, SEEK_SET); write(fd, &argv[1][i], 1); } close(fd); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
