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

Problem1/ fixing bugs The programs b001.c - b010.c are provided for you in the a

ID: 3562436 • Letter: P

Question

Problem1/ fixing bugs

The programs b001.c - b010.c are provided for you in the attached file "bugs.zip". Each program has a bug which needs to be found and eliminated. The correct output from each program appears in the file "outputs_from_corrected_b001-b010.txt". You are to: i) place each source file into a separate directories "ENEE150HW3/Problem1/001/", "ENEE150HW2/Problem1/002/", etc ; ii) create a debug startup file .gdbinit" in each directory which will (at least) "set history save on" so that a record of the steps you took to debug the program will be preserved in a ".gdb_history"file in the directory; iii) debug each program with gdb, find the bug, and comment your fixups with a "//!! " . Problem2/ limits of data types part_a/ finding limits with a program -- limits.c limitfns.c limitfns.h Makefile in /part_a/ Program 'limits' calls functions in limitsfns.c which determine by searching in a 'reasonable' amount of time for the real value limits (highest/greatest/largest,lowest/least/smallest and not 'nan', 'infinity', +0 or -0) of several C datatypes. The functions (names indicate target datatype): i) char greatest_char(void); ii) char least_char(void); iii) unsigned char greatest_unsigned_char(void); iv) long int greatest_long_int(void); v) long double greatest_long_double(void); vi) long_double smallest_positive_non-zero_long_double(void); part_b/ exploring limits with the debugger -- debuglimits.c in /part_b/ Write a small program 'debuglimits.c' which defines and then prints the values of a char, unsigned char, long int, and long double (the types used for Problem2 above). Create a debug startup file ".gdbinit" which will (at least) "set history save on" so that a record of the steps you took during program debug will be preserved in a ".gdb_history" file in the /part_b/ directory. Run your program under gdb and modify the values stored in memory 'by hand' until you discover the greatest, least, or smallest values of variables as per Problem2 above, then let the program print out those values.

Explanation / Answer

/*C Program To Sort data in ascending order using bubble sort.*/ #include int main() { int data[100],i,n,step,temp; printf("Enter the number of elements to be sorted: "); scanf("%d",&n); for(i=0;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