C program to print all disarium numbers between 1 to 1007 Jan 2025 | 2 min read In this program, we need to print all disarium numbers between 1 and 100 by following the algorithm as given below: ALGORITHM:main()
sumOfDigits(num)
calculateLength(int n)
PROGRAM:Output: Disarium numbers between 1 and 100 are 1 2 3 4 5 6 7 8 9 89 Happy NumberA number is said to be happy if it yields 1 when replaced by the sum of squares of its digits repeatedly. If this process results in an endless cycle of numbers containing 4, then the number will be an unhappy number. Let's understand by an example: Number = 32 32+ 22 = 13 12 + 32 = 10 12 + 02 = 1 In this example, we split 32 to get the sum of squares of its digits which forms another number (13), we replace 32 by 13 to continue this cycle until result 1. We found 32 a happy number. If the above cycle for any number results 1 then that number will be a Happy number otherwise that will be an unhappy number resulting 4, 16, 37, 58, 89, 145, 42, 20,?? Some Happy numbers are 7, 28, 100, 320 etc. |
Global Variable in C
Introduction In C programming, a global variable is a variable that is declared outside of any function and can be accessed by any function in the program. Unlike local variables, which are only accessible within their own function, global variables are visible to the entire program. In...
6 min read
Power Function in C
This article will discuss the power function and its various examples in the C language. The power function is used to find the power of any given number. The power function is a predefined library function of the math.h header file, and we need to import...
4 min read
Difference between C and Embedded C
C programming language is a widely used high-level programming language that is popular in the development of operating systems, application software, and system software. Embedded C is a variant of C that is specifically designed for programming embedded systems, such as microcontrollers, microprocessors, and other programmable...
7 min read
Scanset in C
The %[] symbol denotes a scanset specifier that is supported by the scanf family of functions. You can provide a single character or a range of characters inside the scanset. Only characters that are a part of the scanset will be processed by the scanf() function...
2 min read
Symmetric Matrix in C
Introduction: A square matrix is considered to be symmetric if its transpose equals the supplied matrix. The user can generate a symmetric matrix by switching from row to column and from column to row. Any given matrix A can have its transpose matrix specified as AT. As...
4 min read
Ceil Function in C
This section will discuss the Ceil function in the C programming language. Ceil function is a predefined function of math.h header file. It returns the nearest integer number, which is greater than or equal to the number passed as an argument in it. For example, we...
3 min read
ctype.h in C
Ctype.h/cctype> includes inbuilt functions to handle characters in C/C++ in the same way as the string.h header file contains inbuilt functions to handle Strings in C/C++. There are two sorts of characters Printable Characters: The characters that are shown on the terminal are known as printable characters. Control Characters:...
4 min read
How to create your own header files in C
In this article, you will learn how to create your own header files in C with the help of given steps and examples. It is standard practice in C to create your header file to declare functions, data structures, constants, and other declarations that can be shared...
6 min read
Fibonacci Triangle
C Program to generate In this program, we are getting input from the user for the limit for fibonacci triangle, and printing the fibonacci series for the given number of times (limit). Let's see the c example to generate fibonacci triangle. Example #include<stdio.h> #include<stdlib.h> int main(){ ...
1 min read
Differences between Float and Double in C
Both float and double are used to represent floating-point numbers in the C programming language, and their precision and storage capacity are the main differences between the two. In this article, you will learn about the difference between float and double in C. But before discussing...
4 min read
We request you to subscribe our newsletter for upcoming updates.

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India