Posts

Showing posts with the label basic c programs

C program for bubble sort

Bubble sort in c: Bubble sort is the simplest algorithm for sorting elements of array. We can sort elements in ascending and descending order using bubble sort algorithm.

Convert number from octal to binary C program

Convert number from octal to binary. Octal number is a base 8 number and octal number contains 0,1,2,3,4,5,6,7 digits and binary number is a base 2 number and it contains 0 and 1.

Sort array in the wave form C Program

A array is given and sort it in the wave form. Wave form of a array: If array is {1,4,2,7,8,4,9,3} then sort it like {4,1,7,2,8,4,9,3}. Like arr[0]>=arr[1]<=arr[2]>=arr[3]<=arr[4]....

Print a matrix in the wave form C program

Image
You are given a matrix arr[m][n] then print it in the wave form as given in the image.

Decimal to octal conversion C program

Simple C program for decimal to octal conversion

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.