Home » Howto & Style » Task 1 The last digit 0x01. C - Variables, if, else, while #0x01.C #Variables #if #else #alx #task

Task 1 The last digit 0x01. C - Variables, if, else, while #0x01.C #Variables #if #else #alx #task

Written By SCodemy on Sunday, Apr 09, 2023 | 07:51 AM

 
1. The last digit. This program will assign a random number to the variable n each time it is executed. Complete the source code in order to print the last digit of the number stored in the variable n. You can find the source code here The variable n will store a different value every time you run this program You don’t have to understand what rand, srand, and RAND_MAX do. Please do not touch this code The output of the program should be: The string Last digit of, followed by n, followed by the string is, followed by if the last digit of n is greater than 5: the string and is greater than 5 if the last digit of n is 0: the string and is 0 if the last digit of n is less than 6 and not 0: the string and is less than 6 and not 0 followed by a new line. #cprogramming #variables #alx #alxprojects #char #printf #rand #srand