Advertisement
jaOjaa

datstruct BST

May 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include<string.h>
  2. #include<stdio.h>
  3. #include<stdlib.h>
  4. #include<conio.h>
  5. #include<malloc.h>
  6.  
  7. void clrscrn() {
  8. ("system @cls ||clear");
  9. }
  10.  
  11. struct Node {
  12. int price;
  13. int code;
  14. struct Node *right, *left;
  15. };
  16.  
  17. struct Node* root = NULL;
  18.  
  19. void menu() {
  20. printf("NOKIYEM CELLULAR PHONE\n");
  21. printf("- - - - - - - - - - - \n");
  22. printf("\n1. Add new phone\n");
  23. printf("2. Update phone price\n");
  24. printf("3. In-order, Pre-order, Post-order\n");
  25. printf("4. Exit\n");
  26. printf("\n> Input choice : ");
  27. }
  28.  
  29. int main() {
  30. int pil, harga;
  31. int kode;
  32.  
  33. menu();
  34. scanf("%d", &pil);
  35. switch(pil) {
  36. case 1: {
  37. do {
  38. printf("Input phone code N[1-9][0-9][0-9][0-9] : N");
  39. scanf("%d", &kode);
  40. } while (kode<1000 || kode>9999);
  41. do {
  42. printf("Input phone price [$50..$999] : ");
  43. scanf("%d", &harga);
  44. } while (harga<50 || harga>999);
  45. break;
  46. }
  47. case 2: {
  48.  
  49. break;
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement