#include<stdio.h>#include<stdlib.h>int *a,n;void bubblesort();void swap_w(int,int);main(){ int i,j; printf("Enter the number of elements "); scanf("%d",&n); a=(int *)calloc(n,sizeof(int)); printf("Enter the elements\n"); for(i=0;i<n;i++) scanf("%d",a+i); bubblesort(0,n-1); printf("The sorted sequence is\n"); for(i=0;i<n;i++) printf("%d ",a[i]); printf("\n"); return;}void bubblesort(){ int i,j; for(i=0;i<n-1;i++) for(j=n-1;j>=i+1;j--)...
Wednesday, 12 March 2014
Thursday, 9 January 2014
Written by Kousik :
C provides some fundamental DATA types. They are int, float, char, double. They are very useful and
important in C language. But they have a limiting fact. The fact is that a
variable of these types can store only one value at a time. With variables of
those types we cannot handle a large volume of data of same type at a time. So
we need a powerful data type with which we can solve this problem. C supports
such a data type called...
Sunday, 5 January 2014
Here in this post we represent two basic C programming examples. Those example are only for the beginners.
v Check whether a number is palindrome or not through C program.
v Check whether a number is prime or not through C program.
Now the answers are given below:
Answer of no 1:
A number is said to be palindrome if the reverse of that number is same as the original number. Coding is given below…
/* C program to check whether...
Subscribe to:
Posts (Atom)