Write a program in C to reverse a number entered by user using the concept of function with return type and arguments.
User-Defined Functions
ENCT 101 · Chapter 7
Your campus trial expires in
Click to unlock Premium0%
— out of — readSign in to save progress
Course Resources
- Chapters
- 10
- Questions
- 8
Past questions by syllabus
User-Defined Functions
Category of Functions
3 questions- 2081 BaishakhChapter 7: User-Defined Functions7.6 Category of Functions
- 2081 ChaitraChapter 7: User-Defined Functions7.6 Category of Functions
Write a program to find the reverse of a number [Suppose $N$]. The program must take value of $N$ from main(), find the reverse of $N$ from user-defined function named FindRev() and display the reverse of $N$ from the main(). Write the output of following program and explain the result with reference to the concept of the storage class.
#include<stdio.h> int main(){ static int a=5; printf("Value of a is: %d\n",a); a=a+10; if(a<20) main(); return 0; } - 2081 KartikChapter 7: User-Defined Functions7.6 Category of Functions
Write a program in C to check happy number entered by user using the concept of function with return type and no arguments [Hint: Happy number is a number for which the sum of the squares of the digits eventually equals 1. For example, 203 is happy because $2^{2} + 0^{2} + 3^{2} = 13$; $1^{2} + 3^{2} = 10$; $1^{2} + 0^{2} = 1$].
Recursive Functions
5 questions- 2082 ChaitraChapter 7: User-Defined Functions7.7 Recursive FunctionsClick to unlock premiumSee the full question with a premium plan
- 2082 ChaitraChapter 7: User-Defined Functions7.7 Recursive FunctionsClick to unlock premiumSee the full question with a premium plan
- 2082 KartikChapter 7: User-Defined Functions7.7 Recursive FunctionsClick to unlock premiumSee the full question with a premium plan
- 2081 BaishakhChapter 7: User-Defined Functions7.7 Recursive FunctionsClick to unlock premiumSee the full question with a premium plan
- 2081 KartikChapter 7: User-Defined Functions7.7 Recursive FunctionsClick to unlock premiumSee the full question with a premium plan