Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<string.h>
- #include<stdio.h>
- #include<stdlib.h>
- #include<conio.h>
- #include<malloc.h>
- void clrscrn() {
- ("system @cls ||clear");
- }
- struct Node {
- int price;
- int code;
- struct Node *right, *left;
- };
- struct Node* root = NULL;
- void menu() {
- printf("NOKIYEM CELLULAR PHONE\n");
- printf("- - - - - - - - - - - \n");
- printf("\n1. Add new phone\n");
- printf("2. Update phone price\n");
- printf("3. In-order, Pre-order, Post-order\n");
- printf("4. Exit\n");
- printf("\n> Input choice : ");
- }
- int main() {
- int pil, harga;
- int kode;
- menu();
- scanf("%d", &pil);
- switch(pil) {
- case 1: {
- do {
- printf("Input phone code N[1-9][0-9][0-9][0-9] : N");
- scanf("%d", &kode);
- } while (kode<1000 || kode>9999);
- do {
- printf("Input phone price [$50..$999] : ");
- scanf("%d", &harga);
- } while (harga<50 || harga>999);
- break;
- }
- case 2: {
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement