Document each command and step of code please Write a C prog

Document each command and step of code please

Write a C program that print out your first name, last name, and your school ID. Using gcc, compile it and next run it to make sure it works, and you don\'t have syntax errors. Do the preprocess on your C file and create the corresponding. i file. Next, compile your file and produce the corresponding .o file. Next, assemble your your .s file to the corresponding .o file. Submit your .c .i, and .s files on BlackBoard. To move files between Linux and Windows you can use WinSCP.

Solution

#include <stdio.h>

int main()

{

                char name[4][16];

                int age[4];

                int id[4];

                char class_name[4][4];

               

                int ID;

                printf(\"Enter ID: \");

                scanf(\"%d\",&ID);

               

                int i;

                for(i = 0; i < 4; i++)

                {

                                printf(\"\ \ Stduent %d\ \",i+1);

                               

                                printf(\"Enter ID: \");

                                scanf(\"%d\",&id[i]);

                               

                                printf(\"Enter name: \");

                                scanf(\"%s\",name[i]);

                               

                                printf(\"Enter class name: \");

                                scanf(\"%s\",class_name[i]);

                                getchar();

                                printf(\"Enter age: \");

                                scanf(\"%d\",&age[i]);

                }

               

                //..SEARCH INDEX OF ID

                printf(\"Information of ID : = %d\ \ \",ID);

                for(i =0; i < 4; i++)

                                if(ID == id[i])

                                                break;

               

                if(i == 4)

                                printf(\"ID not found\ \");

                else

                {

                                printf(\"\ \ \ Student ID : %d\ \",id[i]);

                                printf(\"Student name: %s\ \",name[i]);

                                printf(\"class name : %s\ \",class_name[i]);

                                printf(\"Student age : %d\ \",age[i]);

                               

                }

}

Document each command and step of code please Write a C program that print out your first name, last name, and your school ID. Using gcc, compile it and next ru
Document each command and step of code please Write a C program that print out your first name, last name, and your school ID. Using gcc, compile it and next ru

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site