Category: C Programming
-
Program in C to get Kaprekar’s constant
Write a C program to get kaprekar’s constant i.e 6174 as the ultimate answer of difference between ascending and descending arrangement of digits of a 4 digit number having at least two different digits. What is Kaprekar’s constant? When we take a 4-digit integer, generate the largest and smallest integers from its digits, and then…
-
Program in C to count frequency of each character in a word
The following program checks, counts and displays the number of times each character has been repeated in a given string by the user.
-
Program in C to display 5, 55, 555, 5555, 55555
In order to display the given pattern in C, we can do the following: C Program Source Codes to display555555555555555 Program Output C Program Source Codes to displaynnnnnnnnnnnnnnn Here, n is any user-entered integer.
-
Program in C to display Fibonacci series
The arrangement of numbers in the below-mentioned pattern is called Fibonacci series: 1 1 2 3 5 8 13 21 34 55 …. We start with the numbers 0 and 1 and print them. Then, the next number in the series would be the sum of previous two numbers. 0 + 1 = 11 +…