Posts

Showing posts from May, 2015

C Program to print string using recursion

Simple C program to print string using recursion .

C Program to reverse string using recursion

Simple C program to reverse string using recursion: If string is "C Basic Examples" then program will print "selpmaxE cisaB C".

C Program to print array using recursion

Simple C program to print array using recursion.

C Program to find largest element of array using recursion

Simple C program to find largest element of array using recursion: If array is {3,7,4,9,2,20,2,1} then it will print 20.

C Program to find smallest element in array using recursion

Simple C program to find smallest element in array using recursion: If array is {20,45,13,54,17} then program will print 13. In this array smallest element is 13.

C Program to check whether array is sorted or not using recursion

Simple C program to check whether array is sorted or not using recursion. This is a simple C program using recursion. If array is sorted then it will print that array is sorted otherwise it will print array is not sorted.

C Program to reverse array using recursion

Simple C program to reverse array using recursion: If array is {2,4,7,2,8} then program will print {8,2,7,4,2}.

C Program to reverse number using recursion

Image
Simple C program to reverse number using recursion: If the number is 2345 then program will print 5432.

C Program to find largest element in array

Image
Simple C program to find largest element in array.

C Program to check armstrong numbers

Image
Simple C program to check Armstrong numbers: A number is called Armstrong number if the sum digits raise to power total number of digits is equal to the number itself. For example 153=1^3+3^3+5^3 so 153 is an Armstrong number and number 30 is not an Armstrong number because 3^2+0^2 !=30.

C Program to find largest element in linked list

Simple C program to find largest element in linked list.

C Program to print first n prime numbers

Image
Simple C program to print first n prime numbers: Prime number is that number which is divisible only by 1 and itself. First prime number is 2 and prime number are 2,3,5,7,11,13,17,19... . This is a simple C program to print first n prime number. If you enter 5 then it will print first 5 prime numbers that are 2,3,5,7,11.

C++ Program to add two integers

Image
Simple C++ program to add two integers:

C++ Program to print character

Image
In C++, to get input by user, we use cin>> and to print something we use cout<<.

C Program to check fibonacci numbers

Image
Simple C program to check Fibonacci numbers: Fibonacci series is 0,1,1,2,3,5,8,13,21.. So if number is in this series then program will print that number is in Fibonacci series otherwise number is not in Fibonacci series.

C++ Program to print integer

Image
Simple C++ program to print an integer.

C++ Program to print hello world

Image
Simple C++ program to print hello world.

C Program to check prime numbers

Image
Simple C program to check prime numbers: Prime number is a number which is divisible only by one and itself. For example number 8 is not prime number because it is divisible by 1,2,4 and 8. But number 17 is prime number because it is divisible by only 1 and 17.

C Program to print diamond

Image
Simple C program to print diamond.

C Program to check palindrome numbers

Image
Simple C program to check palindrome numbers: Palindrome number is a number which does not change if we reverse it. For example some numbers are 121, 123321,88988. To check palindrome number, reverse it and compare with original number.

C program to convert binary number to decimal number

Image
Simple C program to convert a binary number to decimal number.

C Program to convert decimal number to binary number

Image
Simple C program to convert decimal number to binary number.

C Program to add 1 to n numbers

Image
Simple C program to add 1 to n numbers. Here n is input by user. To add 1 to n numbers, there is a math's formula n*(n+1)/2. This formula is used by given program.

C Program to reverse number

Image
Simple C program to reverse number.

C Program to add n numbers

Image
Simple C program to add n numbers.

C Program to determine string length

Image
Simple C program to find length of string: In C language, char array is called by string and at the end of string, there is null character. Null character is denoted by '\0'. So here is a C program to determine length of string using null character.

C Program to print string

Image
Simple C program to display string on the screen. To print a string we use %s.

C Program to toggle letter case

Image
Simple C program to toggle alphabet case. For example if a character is 'S' then after toggle it will be 's'.

C Program to determine size of array

Image
Simple C Program to find length of array

C Program to print array

Image
Simple C program to print an array. Array is secondary data type and a collection of same data types. For example an int array is a collection of int data type.

C Program to calculate LCF

Image
Simple C Program to calculate least common multiple of two numbers.

C Program to calculate HCF

Image
Simple C Program to calculate highest common factor of two numbers.

C Program to calculate sum of digits of a number

Image
Simple C Program to calculate sum of digits of a number.

C Program to find factorial

Image
Simple C program to calculate factorial of a number.

C Program to check leap year

Image
A year will be leap year:- (i) If it is divisible by 400 (ii) If it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100 it is not leap year unless it is divisible by 400. For example 1900 is not a leap year but 1904 is a leap year.

C Program to find size of int char float double

Image
Simple C program to find size of int, char, float and double. To find size of primary data type, we use sizeof() function.

C Program to swap two numbers

Image
Simple C program to swap two numbers.

C Program to find largest among three numbers

Image
Simple C program to find largest number among three numbers.

C Program to find largest between two numbers

Image
Simple C program to find largest number between two numbers.

C Program to find absolute value

Image
Absolute value means remove negative sign if any in the front of number. If the number is 5 then absolute value of 5 is 5. If number is -5 then absolute value of -5 is 5.

C Program to check whether input number is positive or negative

Image
Here is simple to check whether input number positive or negative. If number is less then 0 then it is negative other wise it is positive number.

C Program to ASCII value of a character

Image
A character denotes any alphabet, digit or any special symbol. In C there is a ASCII value for every character. Here is simple C program to print ASCII value of any character.

C Program to check whether input alphabet is consonat or not

Image
Here is simple C program to check a input alphabet is consonant or not. a,e,i,o,u,A,E,I,O and U are vowel, except these alphabets, all alphabets are consonant.

C Program to check whether input alphabet is vowel or not

Image
Here is a simple C program to check input alphabet is vowel or not. In alphabet a,e,i,o,u,A,E,I,O and U are vowel. If input alphabet is one of these vowel, program will give output that alphabet is vowel.

C Program to check number even or odd

Image
A simple C program to check whether number is even or odd. In given program, modulus operator is used. Suppose number is 4 then remainder is when we divide this number with 2, is 0. 4%2=0.

Check whether a character is alphabet or not C Program

Image
Simple C program to check a character whether it is a alphabet or not.

Compute remainder C Program

Image
C program to compute remainder. To compute remainder, we use % operator.

Print 1 to n numbers C program

Image
Here is a simple program to print numbers 1 to n.

Area of circle C Program

Simple C program to calculate are of circle. How to find area of circle.

Addition subtraction multiplication division of two numbers C Program

Image
Here is simple C program to perform addition, subtraction, multiplication and division of two numbers.

Print floating point number C Program

Image
Here is C program to display floating point number on screen. To display floating point number, we use %f.

Addtion of two integer C Program

Image
C Program is given to add two integer. Two add two numbers, we use + arithmetic operator.

Print Character C Program

Image
This is simple C Program to display character on the screen. %c is used to display a character. To display  integer, we use %d. To display floating point number, we use %f. To store character in a variable, we use apostrophe.

Print Integer C Program

Image
Here is C program to print integer. Here int is a keyword to declare integer variable.

Print Hello World

Image
Here is a C Program to print Hello World. Hello world is one of the most simple program in C language. Try it by yourself.

Print Hello World C Program

First C program to print hello world. Here we are providing many C program to print hello world.