BASIC TO INTERMEDIATE PROGRAMS IN C

 Basic To Intermediate level programs in C

C is the basic, general-purpose programming language. C language is the best choice to learn programming for beginners. Coder Insect will guide you in this learning journey.

The best way to learn programming is by practicing different examples by your own . Here, we have included  basic to intermediate level programs like Fibonacci series, Palindrome number, Armstrong number, strong number, Perfect number, Prime number, Decimal to binary, Decimal to octal, Binary code to gray code, Happy number, Neon number , Krishnamurthy Number , IP address program, program to add complex numbers  and many other programs in C programming language. 


1 . Prime Number Program In C

In this example , you will learn a program to check whether a given number is prime number or not. Prime number is greater than 1 and can be only divided by 1 and itself, is called a prime number. In short, Prime numbers can't be divided by other numbers than itself and 1.




2. Krishnamurthy Number Program In C

In this example, you will learn a program to check whether entered number is Krishnamurthy number or not.A krishnamurthty  number is a number whose sum of the factorial of digits is equal to the number itself. ......Hence, 40585 is a Krishnamurthy Number.




3. Program To Convert Binary Code To Gray Code

 In this example, you will learn a program to convert the Binary code into its equivalent Gray code.     .....Program: //program to convert binary code to gray code #include<stdio.h>int bintogray(int).....



4.Program To Swap Two Numbers Using Bitwise XOR

In this example, you will learn a program to swap the contents of two numbers using Bitwise XOR operation. Program: //Program to swap the content of two numbers using Bitwise Xor operation #include<stdio.h>  int main( ).....





5.Program To Display IP Address Of The system

 In this example,  you will learn a program to display the IP address of the system.An IP (Internet Protocol) address is an identifier assigned to each computer and other device (ex. router, mobile etc)connected to IP network that is used to locate and identify the node in the communication....



6. Program To Sort Strings In Lexicographical Order

In this example, you will learn a program to sort 5 strings in the lexicographical order i.e. dictionary order.   ....Program: //Program to sort strings in lexicographical order  #include<stdio.h>  #include<string.h> int main( )...



7. Decimal To Octal Conversion Program In C

In this example, you will learn a program to convert decimal number to its equivalent octal number. Decimal numbers have base 10 , and they use numbers between o to 9.  while, Octal  numbers have base 8 , and they use numbers between 0 to 7.  ( To understand this program , you should have prior knowledge.......



8. Program To Add Two Complex Numbers By Passing Structure To Function

In this example , you will learn a program to add two complex numbers by passing structure to function.   ......Program: //Program to add two o add two complex numbers #include<stdio.h>  typedef struct complex { float real;  .....



9. Program To Find Roots Of Quadratic Equation

In this example, you will learn a program to find the roots of quadratic equations. The standard form of Quadratic equation is:  ax²+bx+c = 0,  and a,b,c are the real numbers  such that a !=0.....



10. Neon Number Program In C

In this example , you will learn a program to check whether entered number is Neon number or  not.  Neon number is the number whose sum of digits of square of number is equal to the number itself.  Lets consider one example,   suppose we want to check whether 9 is neon number or not........



11.Happy Number Program In C

In this program , you will learn a program to check whether entered number is Happy number or not. In number theory, a happy number is a number which eventually reaches 1 when replaced by the sum of squares  of each digit. Suppose we want to check whether 19 is happy number or not.....



12.Strong Number Program In C

In this example , you will learn a program to check whether entered number is strong number or  not. If sum of factorials of digits of a number is equal to the original number, then it is called as Strong number. suppose we have to check whether 145 is strong number or not ....



13. Program To Convert Decimal Number To Binary Number

In this program , you will learn to write a program to convert Decimal numbers into Binary numbers. Some binary numbers for the decimal numbers:........Program: //convert decimal number to binary number  #include<stdio.h>  int main( ) {......



14. Armstrong Number Program In C

In this example, you will learn a program to check whether given number is Armstrong  number or not. If sum of cubes of digits of a number is equal to the original number itself, is called as Armstrong Number. Example:consider the number 153, Let's calculate the sum of cubes of its all digits......




15. Palindrome Number Program In C

In this program you will learn to check whether entered number is palindrome or not. A number is palindrome if and only if the reverse of that number is equal to original number . Example:121 is palindrome. //check whether entered number is palindrome number or not. #include int main() { ..... 



16. Fibonacci Series Program In C

In this example , you will learn to print the Fibonacci series upto n terms (entered by user).  The Fibonacci series is sequence in which next term is the sum of previous two terms. The first two terms of the Fibonacci series are 0 and 1. The Fibonacci series of first 10 terms is :  0     1      1       2      3     5    8     13    21      34


 
(We will continue to add more interesting and useful programs regularly. If you find this useful, then do follow.)



Comments

Post a Comment

Popular posts from this blog

DECIMAL TO OCTAL CONVERSION IN C

PROGRAM TO CONVERT BINARY CODE TO GRAY CODE

KRISHNMURTHY NUMBER PROGRAM IN C