Posts

Showing posts from July, 2020

Automorphic Number in C Programming || Learning Duniya

Image
What will be the programming of Automorphic Number? Today we are going to learn about the  Automorphic Number .  We will learn definition , some example, programming and logic behind the  Automorphic Number   and also look at the output either input number is  Automorphic Number   or not. What is Automorphic Number? Automorphic Number is a such type of mathematical number whose square end is equal to the original number. Means if you square the number then the end of that number is equal to original number. Example:- Lets take 5. Then square of it is 25 and this numbers ends with 5 , and last number is equal to original number. Another example 7. Then the square of this number is 49 and end number is 9, which is not equal to the original number. Programming :- #include<stdio.h> #include<conio.h> #include<math.h> int main() { int num, temp,sqrNum, count,last,temp1;    //Data type decelaration printf( "Enter the numb...

Harshad Number in C Programming => Learning Duniya

Image
What will be the programming for Harshad Number? Today we are going to learn about the  Harshad Number. We will learn definition , some example, programming and logic behind the  Harshad Number and also look at the output either input number is  Harshad Number or not. What is Harshad number or Niven Number? Harshad Number are those number whose number base  is divisible by its sum of digit. Means a number is divisible by its same number base with its digit sum. It was first define by Indian Mathematician name   Dattatreya Ramchandra Kaprekar .   He named this number with a Sanskrit  word which means joy-giver. It is also called as Niven Number this name was introduce  by Ivan M. Niven in 1977. Example :- Let us assume a number 12 then its digit sum is 1 + 2 = 3 and 12 divide by 3 is equal to 4 and all these number are of same base and also 12 is divisible by 3 so it is  Harshad Number. 12 / (1+2) = 12 / 3 = 4. Let us assume a numbe...

Abundant Number in C Programming || Learning Duniya

Image
What will be the programming for Abundant Number?  Today topic is  Abundant Number. we will discuss about, what is  Abundant Number, what are the examples of  Abundant Number, and its programming stuff with program, logic, some output either number is  Abundant Number or not. What is Abundant Number? Abundant Number are same as  Perfect Number  but there is  slit difference, that a number is  Abundant Number when it factor sum or divisor sum is greater then the number, means when we find factor or divisor then the sum of all divisor or factor except that number is greater then that number it is called  Abundant Number. Example:- Let us take a number 30 when we find its divisor we will get 1, 2, 3, 5, 6, 10, 15, 30. But we will not include 30, so sum is :- 1 + 2 + 3 + 5 + 6 + 10 + 15 = 42 which is greater then the original number, so 30 is  Abundant Number.   Let take another number 29 when we will find its divisor  we...

Strong Number in C programming --- Learning Duniya

Image
What will be the programming for Strong Number? Today topic is  Strong Number . We will discuss about  Strong Number, what is  Strong Number, example of it, it's programming logic and output either a given number is  Strong Number or not. What is Strong Number? Strong Number are such number whose factorial sum of its digit is equal to that number is called  Strong Number. Means a sum of digit factorial is equal to that number. Example: lets take a number 145. 145 digits are 1, 4, 5 and its factorial sum :- 1! + 4! + 5!= 1+ 24 + 120 = 145 . Which is equal to the original number, then this number is  Strong Number.  Lets take another number  123. 123 digits are 1, 2, 3 and its factorial sum :- 1! +2! + 3! = 1+ 2 + 6 = 9 which is not equal to original number, then it in Not   Strong Number. Programming:- #include<stdio.h> #include<conio.h> int main() { int num, i, temp,count, temp1,newNum = 0 ;  //Data type deceleration...

Perfect Number in C Programming. || Learning Duniya.

Image
What will be the programming for Perfect Number ? Today topic is Perfect Number. We discuss about   Perfect Number and its logic how to find perfect number by programming and we will also write a program to find  Perfect Number and also see the output that is it number is  Perfect Number or not.  What is Perfect Number? Perfect Number are those number whose sum of its postie divisors except that number is equal to that  number. Means that a number having its all  factor except that number and we add all factor then the number must be equal to that number then its is called  Perfect Number. Example:-- For example, let we take a number 6 and we find it factor then all factor are:- 1,2,3,6. and we have to add all factor except that number then sum will be:- 1+2+3 = 6 , which is equal to original number. Then 6 is  Perfect Number . Programming :- #include<stdio.h> #include<conio.h> int main() { int num, i, newNu...

Palindrome Number in C Programming.

Image
What will be the programming for Palindrome number in C programming? What is Palindrome Number? Palindrome Number are such number when we reverse its digit its remain same. Such number are called Palindrome Number.  Means when we reverse  digit of a number then it will be equal to that original number.  Example:- 101 when we reverse its digit then it will became 101 and both number are same so 101 is Palindrome Number. But when we take another number 102 and reverse its digit then its become 201 and both number are not equal or same so 102 is not a Palindrome Number. Programming:- #include<stdio.h> #include<conio.h> int main() { int num, sum = 0, temp, count;  //Data type deceleration. printf( "Enter any number to check ether it is Palindrome number or not" ); scanf( "%d" ,&num); //User input  temp = num;   while (temp > 0 )   // Loop for finding Palindrome number { count = temp % 10 ; sum = (sum * 10 )...

Fibonacci Series in C.

Image
What will be the program for Fibonacci  Series in C programming language? What is Fibonacci Series? Fibonacci Series is a such type of mathematical series in which sum of previous two number is the next number and the first two number will be 0, and 1. This two number are fixed. This series was developed by an Italian Mathematician named  Leonardo  .  There is huge story behind this series. That a farmer wants to that how much he can have rabbit in a year with a pair of rabbit. So this series was introduce. I will not go in details of this story. Lets see the example of this series.  Example :- 0, 1, 1, 2, 3, 5, 8,  13, 21, 34, 55, 89, 144, 233, .................... This series is known as Fibonacci Series. Programming:- #include<stdio.h> #include<conio.h> int main() { int num1 = 0, num2 = 1, temp, i, n;  //Data type deceleration. printf( "Enter the last count of the series " ); scanf( "%d" ,&n);  // User input of last...

How to Print The Given Pattern

Image
What will be the solution of the given pattern in c programming language? Fig:-1 This program is executed on DEV C++ editor. You may use any C or C++ editor to execute the program. logic and programming will be same. For this programming there are many type of programming solution. But I will discus only two of them one the best solution and one the common solution which you found on Internet. 1st type of solution and it's logic. Programming:- #include<stdio.h> #include<conio.h> int main() { int row,col;          //variable deceleration.  for (row= 1 ;row<= 5 ;row++)        // For row { for (col= 1 ;col<=row;col++)      //For  column { printf( " %d" ,col);        //Printing Number pattern   } printf( "\n" );                    //For new line }          getch();    ...