Become Our Fan on Social Sites!

Facebook Twitter

Google+ RSS YouTube
Showing posts with label c-language. Show all posts
Showing posts with label c-language. Show all posts

Wednesday 25 December 2013

Christmas Tree Program In C Language

Following C language code generates Christmas Tree as output. In below code we are used recursion, that reduces number of line of code. We make separate function to draw tree named "christmas(int)". And at the end of tree we print "Merry Christmas!".

Thursday 24 October 2013

Find LCM using C language

Write a program for to find L.C.M. of two given numbers using C language. Following is a source code of L.C.M. (Lowest (Least) Common Multiples).

Generate numbers using loops

Generate following output using for loops

1     2   3   4   5

10   9   8   7   6

11 12 13 14 15

20 19 18 17 16


Friday 11 October 2013

Reverse Integer Array Without Using Another Array

C program for reverse integer array without using another array that means swapping values.

Thursday 3 October 2013

Matrix multiplication program in C language

This tutorial teaches about Matrix Multiplication. Matrix is an array of rows and columns. Matrix Multiplication is a binary operation and finally generates new matrix.
Matrix Multiplication Program In C Language
Matrix Multiplication ~ All Code Tips

Selection Sort Using C Language

In computer science, selection sort is a sorting algorithm, specifically an in-place comparison sort. It has O(n2) time complexity, making it inefficient on large lists, and generally performs worse than the similar insertion sort.

Read text file using C language

Following C program reads given text file and print its contents on the screen.

Print pascal triangle using C language

In mathematics, Pascal's triangle is a triangular array of the binomial coefficients. It is named after the French mathematician Blaise Pascal.

Reverse array in C language

 Program for to reverse array of integer. Following program reverses array. If array like 
arr[0] = 11
arr[1] = 22
arr[2] = 33
then reverse of this array is
arr[0] = 33
arr[1] = 22
arr[2] = 11

C program for to remove extra spaces between words

If string contains more than one spaces then following C program removes extra spaces between words.

To get IP (Internet Protocol) address using C language

IP stands for Internet Protocol, and it is unique to every computer. "ipconfig" is a command of dos. We are executing "ipconfig" command using C program. Following program outputs IP address, sub-net mask and default gateway. This program works only in Windows.

Wednesday 2 October 2013

Print date using C language program

Using C language print current date. This program works only in Turbo C.

C program to check character is a vowel or not

There are five vowels like 'a',  'e', 'i',  'o', and 'u'. Following C program checks that inputted character is vowel or not.  

Tuesday 1 October 2013

Tower of Hanoi program in C language

C program for Tower of Hanoi using Recursion. Following is a C program of Tower of Hanoi.

Generate random number using C language

Random number: Random number is a number generated by rand() function of stdlib.h header file. This function is used to generate random number in particular range. For example  random number range like 90 to 110.

Sunday 29 September 2013

Decimal to Binary program in C language

The decimal (base ten) numeral system has ten possible values (0,1,2,3,4,5,6,7,8, or 9) for each place-value. In contrast, the binary (base two) numeral system has two possible values, often represented as 0 or 1, for each place-value. In this program if you enter 15 as input(decimal no) then output is 1111 as in binary. Following is a source code of decimal to binary program in c language.

Friday 27 September 2013

C Program To Compare Two Strings

Following c programs checks two strings are same / equal or not. There are three versions of string comparison: 1) Using strcmp() function, 2) Without using strcmp() function and 3) Using pointer. Program using strcmp() function is not included in following codes.

C program to check for palindromes

Palindrome Number : If number is like 121 and reverse of that number is also same. So we can say that the number is palindrome. Palindrome String : If string is like 'radar' and reverse of that string is also same then that string is known as palindrome string.

C program for to find perfect number or not

Perfect Number : A perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself. For example 6 is a perfect number because 1 + 2 + 3 = 6 that is equal to number itself.

C program for concatenate two strings

C program for concatenate two strings or append string with another string.