Showing posts with label c program. Show all posts

C program for Huffman's Algorithm



Huffman's Algorithm



Huffman's Algorithm

C program for Dijkstra's Algorithm



Dijkstra's Algorithm



Dijkstra's Algorithm

How to run Turbo c full screen in windows 7 without any software



I know u most aware with turbo c language.This compiler is easily full screened with XP.
But we can not use it in full screen in win 7 and win vista.
so we need software having name dosbox for that.but in this trick i will just give instruction how to make Turbo C in Full screen without any software

Steps :
Step 1 : go to c:/tc/bin and find tc.exe
Step 2 : Right click on tc.exe and go to properties
Step 3 : in the properties go to Screen Tab
Step 4 : in Screen tab u got option about Usage in that properties click on windows instead of Full screen.
Step 5 :after that run tc.exe, click ignore if ask (if not then do nothing) it will open it in normal small window.
Step 6 :right click on the border and go to properties.then move to fonts tab.
Step 7 : select lucida console and size 28


Enjoy


I know u most aware with turbo c language.This compiler is easily full screened with XP.
But we can not use it in full screen in win 7 and win vista.
so we need software having name dosbox for that.but in this trick i will just give instruction how to make Turbo C in Full screen without any software

Steps :
Step 1 : go to c:/tc/bin and find tc.exe
Step 2 : Right click on tc.exe and go to properties
Step 3 : in the properties go to Screen Tab
Step 4 : in Screen tab u got option about Usage in that properties click on windows instead of Full screen.
Step 5 :after that run tc.exe, click ignore if ask (if not then do nothing) it will open it in normal small window.
Step 6 :right click on the border and go to properties.then move to fonts tab.
Step 7 : select lucida console and size 28


Enjoy

C Program for operations on a queue represented using circular linked list


/* Program for showing various operations on a queue  represented
   using circular linked list. */.

output :>
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
6. Quit
 Enter your option:     1
 
Enter queue data : 23
 
 
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
6. Quit
 Enter your option:     1
 
Enter queue data : 34
 
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     1
 
Enter queue data : 45
 
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     3
 
23  34  45
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     4
 
Front Element = 23
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     5
 
Rear Element = 45
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     6




/* Program for showing various operations on a queue  represented
   using circular linked list. */.

output :>
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
6. Quit
 Enter your option:     1
 
Enter queue data : 23
 
 
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
6. Quit
 Enter your option:     1
 
Enter queue data : 34
 
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     1
 
Enter queue data : 45
 
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     3
 
23  34  45
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     4
 
Front Element = 23
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     5
 
Rear Element = 45
1. Insert
2. Delete
3. Print
4. Front element
5. Rear Element
6. Quit
 Enter your option:     6



c program for Conversion of an expression from prefix into infix and postfix


/*Conversion of an expression from prefix into infix
  Conversion of an expression from prefix into postfix
*/

output :>
Enter a prefix expression :+a*bc
                                                                                  
Postfix :    abc*+
Infix :     (a+(b*c))


/*Conversion of an expression from prefix into infix
  Conversion of an expression from prefix into postfix
*/

output :>
Enter a prefix expression :+a*bc
                                                                                  
Postfix :    abc*+
Infix :     (a+(b*c))

C program for Conversion of an expression from postfix into infix and vice verse


/*Conversion of an expression from postfix into infix
  Conversion of an expression from postfix into prefix
*/

output :>
Enter a postfix expression :abc*+                                               
                                                                                  
Prefix :    +a*bc                                                               
Infix :     (a+(b*c))

/*Conversion of an expression from postfix into infix
  Conversion of an expression from postfix into prefix
*/

output :>
Enter a postfix expression :abc*+                                               
                                                                                  
Prefix :    +a*bc                                                               
Infix :     (a+(b*c))

C program for all infix and postfix operation

/* program for conversion of:
             1. infix into its postfix form
             2. infix into its prefix form
             3. Evaluation of postfix expression
             4. Evaluation of prefix expression
   operators supported '+,-,*,/,%,^,(,)
   operands supported -- all single character operands
*/

output :>
Enter an infix expression : a+b*c                                              
                                                                                 
Postfix : abc*+                                                                
 prefix: +a*bc                                                                  
Prefix Evaluation :                                                            
Enter the value of c : 12                                                      
                                                                                 
Enter the value of b : 24
                                                                                 
Enter the value of a : 10                                                      
                                                                                 
value of expression = 298                                                      
Postfix evaluation :
Enter the value of a : 2                                                        
                                                                                 
Enter the value of b : 3                                                        
                                                                                 
Enter the value of c : 4                                                        
                                                                                 
value of expression = 14



/* program for conversion of:
             1. infix into its postfix form
             2. infix into its prefix form
             3. Evaluation of postfix expression
             4. Evaluation of prefix expression
   operators supported '+,-,*,/,%,^,(,)
   operands supported -- all single character operands
*/

output :>
Enter an infix expression : a+b*c                                              
                                                                                 
Postfix : abc*+                                                                
 prefix: +a*bc                                                                  
Prefix Evaluation :                                                            
Enter the value of c : 12                                                      
                                                                                 
Enter the value of b : 24
                                                                                 
Enter the value of a : 10                                                      
                                                                                 
value of expression = 298                                                      
Postfix evaluation :
Enter the value of a : 2                                                        
                                                                                 
Enter the value of b : 3                                                        
                                                                                 
Enter the value of c : 4                                                        
                                                                                 
value of expression = 14



C program for Polynomal using a circular linked list


/*
 Represent a Polynomal using a circular linked list and write
 menu driven program to perform addition,multiplication and
 evaluation.
*/

output :>
1)Create first polynomial                                                      
2)Create second polynomial                                                      
3)Print first polynomial                                                        
4)Print second polynomial                                                      
5)Add                                                                          
6)Multiply
7)Evaluate First Polynomial                                                    
8)Quit                                                                          
Enter Your Choice: 1                                                            
                                                                                 
Enter No. of Terms:2                                                            
                                                                                 
enter a term as a tuple of (power,coefficient) : 1 3 2 1                        
                                                                                 
1)Create first polynomial                                                      
2)Create second polynomial                                                      
3)Print first polynomial                                                        
4)Print second polynomial                                                      
5)Add                                                                          
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 3
 
  3.00x^1     1.00x^2
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 2
 
Enter No. of Terms:2
 
enter a term as a tuple of (power,coefficient) : 5 1 6 2
 
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 5
 
  3.00x^1     1.00x^2     1.00x^5     2.00x^6
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 6
 
  3.00x^6     7.00x^7     2.00x^8
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 7
 
Enter the value of X:2
 
Evaluated value =  10.00
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit

Enter Your Choice: 8




/*
 Represent a Polynomal using a circular linked list and write
 menu driven program to perform addition,multiplication and
 evaluation.
*/

output :>
1)Create first polynomial                                                      
2)Create second polynomial                                                      
3)Print first polynomial                                                        
4)Print second polynomial                                                      
5)Add                                                                          
6)Multiply
7)Evaluate First Polynomial                                                    
8)Quit                                                                          
Enter Your Choice: 1                                                            
                                                                                 
Enter No. of Terms:2                                                            
                                                                                 
enter a term as a tuple of (power,coefficient) : 1 3 2 1                        
                                                                                 
1)Create first polynomial                                                      
2)Create second polynomial                                                      
3)Print first polynomial                                                        
4)Print second polynomial                                                      
5)Add                                                                          
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 3
 
  3.00x^1     1.00x^2
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 2
 
Enter No. of Terms:2
 
enter a term as a tuple of (power,coefficient) : 5 1 6 2
 
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 5
 
  3.00x^1     1.00x^2     1.00x^5     2.00x^6
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 6
 
  3.00x^6     7.00x^7     2.00x^8
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit
Enter Your Choice: 7
 
Enter the value of X:2
 
Evaluated value =  10.00
1)Create first polynomial
2)Create second polynomial
3)Print first polynomial
4)Print second polynomial
5)Add
6)Multiply
7)Evaluate First Polynomial
8)Quit

Enter Your Choice: 8



C program to merge linked lists with sorted data


/*Merging of linked lists with sorted data */
/* prgram :
   Create two singly linked lists sort one after creation & one while
   creation.Merge these two lists into one list without creating a
   new node*/

output :>

Creating Normal(unsorted) linked list
 
Number of nodes:2
 
Enter data:12
23
 
Creating sorted linked list
 
Number of nodes:3
 
Enter data:12 23
34
 
First LInked list(Before Sorting):
   12   23
First Linked list(After Sorting):
   12   23
Second Linked list:
   12   23   34
Final List:
   12   12   23   23   34




/*Merging of linked lists with sorted data */
/* prgram :
   Create two singly linked lists sort one after creation & one while
   creation.Merge these two lists into one list without creating a
   new node*/

output :>

Creating Normal(unsorted) linked list
 
Number of nodes:2
 
Enter data:12
23
 
Creating sorted linked list
 
Number of nodes:3
 
Enter data:12 23
34
 
First LInked list(Before Sorting):
   12   23
First Linked list(After Sorting):
   12   23
Second Linked list:
   12   23   34
Final List:
   12   12   23   23   34



C program for Operations on SLL(singly linked list)


/*Operations on SLL(singly linked list) */

 output :>
  1. 1)create                                                                        
  2. 2)Insert                                                                        
  3. 3)Delete                                                                        
  4. 4)Search                                                                        
  5. 5)Reverse                                                                       
  6. 6)Print                                                                         
  7. 7)Quit                                                                          
  8. Enter your Choice:1                                                             
  9.   
  10.  Enter no of data:2                                                             
  11.                                                                                   
  12. Enter the data:12 34                                                            
  13.                                                                                   
  14.                                                                                   
  15. 1)create                                                                        
  16. 2)Insert                                                                        
  17. 3)Delete                                                                        
  18. 4)Search                                                                        
  19. 5)Reverse                                                                       
  20. 6)Print                                                                         
  21. 7)Quit                                                                          
  22. Enter your Choice:2                                                             
  23.                                                                                   
  24.         1)Beginning                                                             
  25.         2)End                                                                   
  26.         3)In between                                                            
  27. Enter your choice : 3                                                           
  28.                                                                                   
  29. Enter the data to be inserted : 22                                              
  30. Insert after which number ? : 12                                                
  31.                                                                                   
  32. 1)create                                                                        
  33. 2)Insert                                                                        
  34. 3)Delete                                                                        
  35. 4)Search                                                                        
  36. 5)Reverse                                                                       
  37. 6)Print                                                                         
  38. 7)Quit                                                                          
  39. Enter your Choice:3                                                             
  40.                                                                                   
  41.         1)Beginning                                                             
  42.         2)End                                                                   
  43.         3)In between                                                            
  44. Enter your choice : 1                                                                               
  45.                                                                                   
  46. 1)create                                                                        
  47. 2)Insert                                                                        
  48. 3)Delete                                                                        
  49. 4)Search                                                                        
  50. 5)Reverse                                                                       
  51. 6)Print                                                                         
  52. 7)Quit
  53. Enter your Choice:4                                                             
  54.                                                                                   
  55. Enter the data to be searched: 12                                               
  56.                                                                                   
  57. Not found:                                                                      
  58.                                                                                   
  59. 1)create                                                                        
  60. 2)Insert                                                                        
  61. 3)Delete                                                                        
  62. 4)Search                                                                        
  63. 5)Reverse
  64. 6)Print                                                                         
  65. 7)Quit                                                                          
  66. Enter your Choice:5                                                             
  67.                                                                                   
  68.                                                                                   
  69. 34  22                                                                          
  70.                                                                                   
  71. 1)create                                                                        
  72. 2)Insert                                                                        
  73. 3)Delete                                                                        
  74. 4)Search                                                                        
  75. 5)Reverse                                                                       
  76. 6)Print                                                                         
  77. 7)Quit                                                                          
  78. Enter your Choice:6                                                             
  79.                                                                                   
  80.                                                                                   
  81. 34  22 
  82.                                                              
  83.                                                                                                 
  84. 2)Insert                                                                        
  85. 3)Delete                                                                        
  86. 4)Search                                                                        
  87. 5)Reverse                                                                       
  88. 6)Print                                                                         
  89. 7)Quit                                                                          
  90. Enter your Choice:7   





/*Operations on SLL(singly linked list) */

 output :>
  1. 1)create                                                                        
  2. 2)Insert                                                                        
  3. 3)Delete                                                                        
  4. 4)Search                                                                        
  5. 5)Reverse                                                                       
  6. 6)Print                                                                         
  7. 7)Quit                                                                          
  8. Enter your Choice:1                                                             
  9.   
  10.  Enter no of data:2                                                             
  11.                                                                                   
  12. Enter the data:12 34                                                            
  13.                                                                                   
  14.                                                                                   
  15. 1)create                                                                        
  16. 2)Insert                                                                        
  17. 3)Delete                                                                        
  18. 4)Search                                                                        
  19. 5)Reverse                                                                       
  20. 6)Print                                                                         
  21. 7)Quit                                                                          
  22. Enter your Choice:2                                                             
  23.                                                                                   
  24.         1)Beginning                                                             
  25.         2)End                                                                   
  26.         3)In between                                                            
  27. Enter your choice : 3                                                           
  28.                                                                                   
  29. Enter the data to be inserted : 22                                              
  30. Insert after which number ? : 12                                                
  31.                                                                                   
  32. 1)create                                                                        
  33. 2)Insert                                                                        
  34. 3)Delete                                                                        
  35. 4)Search                                                                        
  36. 5)Reverse                                                                       
  37. 6)Print                                                                         
  38. 7)Quit                                                                          
  39. Enter your Choice:3                                                             
  40.                                                                                   
  41.         1)Beginning                                                             
  42.         2)End                                                                   
  43.         3)In between                                                            
  44. Enter your choice : 1                                                                               
  45.                                                                                   
  46. 1)create                                                                        
  47. 2)Insert                                                                        
  48. 3)Delete                                                                        
  49. 4)Search                                                                        
  50. 5)Reverse                                                                       
  51. 6)Print                                                                         
  52. 7)Quit
  53. Enter your Choice:4                                                             
  54.                                                                                   
  55. Enter the data to be searched: 12                                               
  56.                                                                                   
  57. Not found:                                                                      
  58.                                                                                   
  59. 1)create                                                                        
  60. 2)Insert                                                                        
  61. 3)Delete                                                                        
  62. 4)Search                                                                        
  63. 5)Reverse
  64. 6)Print                                                                         
  65. 7)Quit                                                                          
  66. Enter your Choice:5                                                             
  67.                                                                                   
  68.                                                                                   
  69. 34  22                                                                          
  70.                                                                                   
  71. 1)create                                                                        
  72. 2)Insert                                                                        
  73. 3)Delete                                                                        
  74. 4)Search                                                                        
  75. 5)Reverse                                                                       
  76. 6)Print                                                                         
  77. 7)Quit                                                                          
  78. Enter your Choice:6                                                             
  79.                                                                                   
  80.                                                                                   
  81. 34  22 
  82.                                                              
  83.                                                                                                 
  84. 2)Insert                                                                        
  85. 3)Delete                                                                        
  86. 4)Search                                                                        
  87. 5)Reverse                                                                       
  88. 6)Print                                                                         
  89. 7)Quit                                                                          
  90. Enter your Choice:7   




C program for Operations on a CDLL(Circular doubly linked list)

/*Operations on a CDLL(Circular doubly linked list) */

download :>
1)create                                                                        
2)Insert
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:1                                                             
                                                                                  
 Enter no of data:2                                                             
                                                                                  
Enter the data:23 34                                                            
                                                                                  
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit
Enter your Choice:2                                                             
                                                                                  
        1)Beginning                                                             
        2)End                                                                   
        3)In between                                                            
Enter your choice : 2                                                           
                                                                                  
Enter the data to be inserted : 12                                              
                                                                                  
                                                                                  
1)create
2)Insert
3)Delete
4)Search
5)Print
6)Quit
Enter your Choice:5
  
23  34  12
  
                                      
                                                                                  
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:3                                                             
                                                                                  
        1)Beginning                                                             
        2)End                                                                   
        3)In between                                                            
Enter your choice : 3                                                           
                                                                                  
Enter the data to be deleted : 23                                               
                                                                                  
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:5                                                             
                                                                                  
34  12                                                                          
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:4                                                             
                                                                                  
Enter the data to be searched: 12                                               
                                                                                  
Found at location=2                                                             
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:6
/*Operations on a CDLL(Circular doubly linked list) */

download :>
1)create                                                                        
2)Insert
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:1                                                             
                                                                                  
 Enter no of data:2                                                             
                                                                                  
Enter the data:23 34                                                            
                                                                                  
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit
Enter your Choice:2                                                             
                                                                                  
        1)Beginning                                                             
        2)End                                                                   
        3)In between                                                            
Enter your choice : 2                                                           
                                                                                  
Enter the data to be inserted : 12                                              
                                                                                  
                                                                                  
1)create
2)Insert
3)Delete
4)Search
5)Print
6)Quit
Enter your Choice:5
  
23  34  12
  
                                      
                                                                                  
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:3                                                             
                                                                                  
        1)Beginning                                                             
        2)End                                                                   
        3)In between                                                            
Enter your choice : 3                                                           
                                                                                  
Enter the data to be deleted : 23                                               
                                                                                  
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:5                                                             
                                                                                  
34  12                                                                          
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:4                                                             
                                                                                  
Enter the data to be searched: 12                                               
                                                                                  
Found at location=2                                                             
                                                                                  
1)create                                                                        
2)Insert                                                                        
3)Delete                                                                        
4)Search                                                                        
5)Print                                                                         
6)Quit                                                                          
Enter your Choice:6
Blogger Tips and TricksLatest Tips And TricksBlogger Tricks