any one can write the 'C' programe for towers of honai with out recursion?
537290
The following web page has the code for Tower of Hanoi removing recursion:\n\nhttp://obelix.ee.duth.gr/~apostolo/TowersOfHanoi/hanoiB.html
785470
There are numerous ways to do that. \nHere is, probably the simplest:\n\nchar *s="char *s=%c%s%c;%cmain() {printf(s,34,s,34,10,10);}%c";\nmain() {printf(s,34,s,34,10,10);}\n\nThe program itself is fairly useless.\nThe whole point of an exercise like this is the satisfaction of finding a solution yourself. Too bad, you did not give yourself a chance
684159
Here:\nhttp://www.oldversion.com/program.php?n=java
894119
Well... the easiest and most general approach is to  traverse the tree in preorder depth-first manner, writing the nodes to the file, and inserting a special separator (a centinel) at the end of each branch - just before the traversal process is about to move up:\n\nvoid write_node (struct node *root, FILE *out)\n{\n    root ? fprintf (out, "%s&#92;n", node_to_string (root, buffer)) :\n    fprintf (out, "%c&#92;n", SENTINEL);\n}\n       \nvoid read_tree (struct node *root, FILE *out)\n{\n   write_node (root);\n    if (!root) return;     \n    save_tree (root->left, out);\n    save_tree (root->right, out);\n}\n\nthen you can read this structure back in  in the same order:\nstruct node* read_node (FILE *in)\n{\n    char buffer[1024];\n    if (!fgets(in, buffer, 1024) || buffer[0] == SENTINEL) return 0;\n   return parse_node (buffer);\n}\n    \nstruct node *read_tree (FILE *out)\n{\n    struct node *root = read_node (out);\n    if (!root) return 0;\n    root->left = read_tree (out);\n    root->right= read_tree(out);\n}
359046
#include <ctype.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nstatic char *article[] = { "the","a", "one", "some", "any" };\nstatic char *noun   [] = { "boy","girl", "dog", "town", "car" };\nstatic char *verb   [] = { "drove","jumped", "ran", "walked", "skipped" };\nstatic char *prep   [] = { "to", "from", "over", "under", "on" };\n\nint\nmain()\n{\n  int asize = sizeof(article)/sizeof(article[0]);\n  int nsize = sizeof(noun)/sizeof(noun[0]);\n  int vsize = sizeof(verb)/sizeof(verb[0]);\n  int psize = sizeof(prep)/sizeof(prep[0]);\n\n  char buff[100];\n  for (int i=0; i<20; i++) {\n    (void)sprintf(buff, "%s %s %s %s %s %s.",\n      article[rand()%asize],\n      noun[rand()%nsize],\n      verb[rand()%vsize],\n      prep[rand()%psize],\n      article[rand()%asize],\n      noun[rand()%nsize]);\n    *buff = toupper(*buff);\n    (void)printf("%s&#92;n", buff);\n  }\n  return 0;\n}\n\n\n$ a.out\nSome town walked to a dog.\nThe car ran from any dog.\nAny boy drove under any town.\nOne girl jumped under the girl.\nOne car jumped to one girl.\nAny boy skipped over a dog.\nAny town jumped from some town.\nThe town ran from the town.\nOne car walked to any town.\nOne town ran over one boy.\nAny town jumped on the car.\nSome dog skipped from a boy.\nSome girl skipped over a boy.\nA car walked over some girl.\nThe car jumped from a girl.\nThe boy skipped on the town.\nAny car walked from one girl.\nAny dog ran to a town.\nA car jumped under some car.\nSome boy walked to the car.
129073
The code below will work.\n\nint main()\n{\nint aNum,i;\ncout<<"enter a number";\ncin>> aNum;\nfor(i=0;i<aNum;i++)\n{\nfor(j=0;j<=i;j++)//nested loop\ncout<<"*";// end of nested loop\ncout<<'&#92;n';\n}// end of outer loop\nreturn 0;\n}
293992
Use TOBA (see link below)\n\nToba translates Java class files into C source code. This allows the construction of directly executable programs that avoid the overhead of interpretation.
162888
if u need any programs in C language..then please send me the questions..I will mail u the solution code..
418058
most the programming softwares has the option for that, just try to figure it o. I can't tell you cos i don't write c-programs
604143
here is a program for 10 numbers in ascending order\n\n#include <iostream.h>\n#include <conio.h>\n\nvoid main()\n{\nclrscr();\nint array[10],t;\nfor(int x=0;x<10;x++)\n{\ncout << "Enter Integer No. " << x+1 << " : " << endl;\ncin>>array[x];\n}\nfor (x=0;x<10;x++)\n{\nfor(int y=0;y<9;y++)\n{\nif(array[y]>array[y+1])\n{\nt=array[y];\narray[y]=array[y+1];\narray[y+1]=t;\n}\n}\n}\ncout << "Array in ascending order is : ";\nfor (x=0;x<10;x++)\ncout << endl << array[x];\ngetch();\n}\n\nThis program takes in the ten integers array[x] to be stored in the single-dimensional array as a screen input from the user.\nIt then sorts out these ten integers into ascending order and prints them out using the 'cout' command.
195373
Try this:\n\n#include <stdio.h>\n\nmain()\n{\nint size,array[50],n,m,border,max,buf,step;\nint i, j, temp;\n\nprintf("Input number of elements in array:");\nscanf("%d",&size);\n\nfor(n=0;n<size;n++) {\n  printf("input %d. element of array:",n+1);\n  scanf("%d",&array[n]);\n  }\n\n for (i=(size-1);i>=0; i--)\n  {\n   for(j=1;j<=i;j++)\n    {\n     if(array[j-1]>array[j])\n      {\n       temp=array[j-1];\n       array[j-1]=array[j];\n       array[j]=temp;\n      }\n     }\n   }\n\nfor(n=0;n<size;n++)\n   printf("%d. element: %d&#92;n",n+1,array[n]);\n\n}\n\n\n\nHERE IS MY OUTPUT:\n\nInput number of elements in array:8\ninput 1. element of array:6\ninput 2. element of array:2\ninput 3. element of array:3\ninput 4. element of array:5\ninput 5. element of array:1\ninput 6. element of array:4\ninput 7. element of array:5\ninput 8. element of array:7\n1. element: 1\n2. element: 2\n3. element: 3\n4. element: 4\n5. element: 5\n6. element: 5\n7. element: 6\n8. element: 7
1056394
Try this link from Planet Source Code. It's in C++, but you should be able to convert it to C:\nhttp://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=5602&lngWId=3
370055
Something like this maybe:\n\n Runtime.getRuntime().exec("C:" + pathSeparator +\n"jdk1.3.1" + pathSeparator + "bin" + pathSeparator + "javac.exe " + file);  } catch(Exception e)  { e.printStackTrace();  }  }  }
376552
Stack. Because of its LIFO (Last In First Out) property it remembers its `caller' so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.
254178
With GCC compiler (used by Dev-++) you can write:\n\nsystem("cls");
588997
I use "C++ How to Program" by Deitel & Deitel.\nIt's really good
816149
Its neither long nor difficult. Here is the program, which uses recursive function to calculate gcd.\n\n#include<stdio.h>\n#include<conio.h>\n\nint find_gcd(int n1,int n2);\nvoid main()\n{\n clrscr();\n int number1,number2;\n printf("Enter two numbers to get lcd and gcd ");\n scanf("%d %d",&number1,&number2);\n if((number1 <= 0) || (number2 <= 0))\n  {\n   printf("Invalid inputs");\n   return;\n  }\n if(number1 == number2) {printf("GCD is %d LCD is %d",number1,number2);getch();return;}\n if(number1 == 1) {printf("GCD is 1 LCD is %d",number2);getch();return;}\n if(number2 == 1) {printf("GCD is 1 LCD is %d",number1);getch();return;}\n int gcd = find_gcd(number1,number2);\n int lcd = ((double)number1 * (double)number2)/gcd;\n printf("GCD is %d and LCD is %d",gcd,lcd);\n getch();\n\n}\n\nint find_gcd(int n1,int n2)\n{\n if(n1 == n2) return n1;\n if(n1 == 1) return 1;\n if((n2 % n1) == 0) return n1;\n if(n1 < n2) return(find_gcd(n2-n1,n1));\n else return(find_gcd(n1-n2,n1));\n}