C language tricky good pointers questions and explanation operators data types arrays structures questions functions recursion preprocessors, looping, file handling, strings questions switch case if else printf advance c linux objective types mcq faq interview questions and answers with explanation and solution for freshers or beginners. Placement online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c c++ tutorials and pdf

29 comments:
not working
Hello friend ur program is working sucessfully. Thanks for it.
cud u put some comments 2 make it easier 2 undrstand
thanx bro!!! u got a good hand in C!!!!!!!!
please put some comments
thanks
hey i need a program for graphical representation of binary search in c
hey can i get a program of queue in c using graphic.c
Good Job
it saves our time ....... thanx
lucky guy
only works if input array is already sorted
seocndly ..for m<a[mid]){ u=mid-1; the loop will go infinte
sorry it wont go infinite..
I think l < u would be correct
It is not working......
can show us it's algorithm as well as flowchart.
good work
for searching,array must be sorted
its realy gud thanx dear
Could always the input be in ascending order?
nice work bro
thank you very much. i feel very easy in using 'c' in this blog. so simple and power
prasad..
simple huffman algorithm
#include
#include
#include
void main()
{
struct huff
{
long int freq,code;
char data[10];
}h[50];
long int n,n1=100,i,j,n2=90,temp;
char tempc[10];
clrscr();
printf("\t\t\tHUFFMAN ALGORITHM\n\n");
printf("Enter the number of character");
scanf("%ld",&n);
for(i=0;i<n;i++)
{
printf("Enter the character::");
scanf("%s",h[i].data);
printf("Enter the frequency for character %s::", h[i].data);
scanf("%ld",&h[i].freq);
}
for(i=0;i<n-1;i++)
{
for(j=1;j<n;j++)
{
if(h[i].freq<h[j].freq)
{
temp=h[i].freq;
h[i].freq=h[j].freq;
h[j].freq=temp;
strcpy(tempc,h[i].data);
strcpy(h[i].data,h[j].data);
strcpy(h[j].data,tempc);
}
}
}
h[0].code=10;
h[1].code=11;
for(i=2;i<n;i++)
{
if(i%2==0)
{
h[i].code=h[i-2].code+n1;
n1=n1*10;
}
else
{
h[i].code=h[i-2].code+n2;
n2=n2*10;
}
}
printf("Huffman code");
printf("\nchar\tfreq\tcode");
for(i=0;i<n;i++)
{
printf("\n%s\t%ld\t%ld\n",h[i].data,h[i].freq,h[i].code);
}
getch();
}
cud u pls do d programs fo findin hcf & lcm ?
good one.....
Yup it should always be in ascending order.
thanx ....but pls put commands....sir
so many closed braces but only one open brace...how ca it work!!!
Post a Comment