Created
July 21, 2015 13:55
-
-
Save raju249/e982c977ef7029cfef7d to your computer and use it in GitHub Desktop.
Revisions
-
raju249 created this gist
Jul 21, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ /** * Searches for a number in list. */ void search(void) { // prompt user for number printf("Number to search for: "); int n = GetInt(); // get list's first node node* ptr = first; // search for number while (ptr != NULL) { if (ptr->n == n) { printf("\nFound %i!\n", n); sleep(1); break; } ptr = ptr->next; } }