Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Document each command and step of code please Write a C program that print out y

ID: 3783408 • Letter: D

Question

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.

Explanation / Answer

#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]);

                               

                }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote