1. Modify Example 2 so that the symbol to draw therectangle, instead of being ‘*
ID: 3618037 • Letter: 1
Question
1. Modify Example 2 so that the symbol to draw therectangle, instead of being ‘*’, should be provided bythe user.
2. Write a function divisors that receives aninteger number and displays its divisors on the screen including 1and itself. Write the main function to test yourfunction.
3. Modify the function divisors so that nowit returns the number of divisors excluding 1 and the numberitself. Write the main to test your function.
The 4 divisors of 32 are 2,4,8 and 16.
4. Write a logical function perfect_Square that receives apositive integer number and checks if it is a perfect square ornot.
Note: perfect square numbers are 4, 9,16,25,36 etc….
Write a main function that makes useof the perfect_Square function to find and print all perfectsquares between n1 and n2. n1 and n2 are end values of arange introduced by the user.
5. (optional)
Write a logical function,is_prime, thattakes an integer number and determines if the number is primeor not.
Note: A prime number is one that doesnot have proper factors.
Write a main function that makes useof the is_prime function to find and print all the prime numbersfrom 2 to 100.
Explanation / Answer
please rate - thanks CRAMSTER rule 1 question per post I will answer 2 related questions #include #include void divisors(int); int main() {int n; printf("Enter an integer number >"); scanf("%d",&n); divisors(n); getch(); return 0; } void divisors(int n) {int i; printf("divisors of %d are ",n); for(i=1;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.