Posts

Code Implementation from Chapter 1 and 2

Hello all! Today, I'm posting an implementation code of linked list. This is related to the link that I've given to you in the last blog (App Store Linked List). If you want to see the code directly in this blog, well then this is the code for you. Don't forget to read my summary and my linked list concept in order to understand this code. Happy coding! #include <stdio.h> #include <stdlib.h> #include <string.h> struct LinkedListNode{ char productName[26]; unsigned int quantity; unsigned long int price; struct LinkedListNode* next; struct LinkedListNode* prev; } typedef LinkedListNode; LinkedListNode* head = NULL; LinkedListNode* tail = NULL; LinkedListNode* temp = NULL; LinkedListNode* oneNode(char productName[], unsigned int quantity, unsigned int price){ temp = (LinkedListNode*) malloc(sizeof(LinkedListNode)); strcpy(temp->productName, productName); temp->quantity = quantity; temp->price = price; temp->next = N...

Lesson Summaries of Semester 1 and 2

Lesson Summaries of Semester 1 and 2 Rangkuman Pembelajaran Selama Semester 1 dan 2 (Semester 1 and 2 Subject Summary): Here are the main points that I'd like to share with you in order to refresh your memory about the basics. 1. How to output something in C: Printf(“This is a text %s”, someText); Printf(“This is a text %i”, someNumber); 2. How to input something in C: Scanf(“%[^\n]”, someString); // Input a sentence Scanf(“%i”, &someNumber); // Input a number 3. Conditional Statements in C: L ong version: If (statement 1 < statement 2){ printf(“Number 1 is larger than number 2”); } Else if (statement 2 > statement 1){                Printf(“Number 2 is larger than number 1”); } Else{                Printf(“Same number”); } Short version by using ternary operator: Int value = number 1 < num...