Introduction to C language

About this Series Welcome everybody, you must be interested in learning about the programming. Guess what, you’re at the correct place. In this series we will learn about how to in and out of C language from very basics of programming to a pretty intermediate level. This post mainly contains the history of C language with introduction to its creator. So lets pack your bag and come with me on a learning trip....

January 2, 2019 · 3 min · Rahul Rajput

How to Create Linked List in C/C++

##Source Code #include <stdio.h> #include <stdlib.h> struct Node{ int data; struct Node *next; }; typedef struct Node *node; node createNewNode(){ node temp; temp = (node)malloc(sizeof(struct Node)); // allocate memory equal memory as the size using malloc() temp->next = NULL;// make next point to NULL (suppose this as last node) return temp; } node addNode(node head, int value){ node tmp,p; tmp = createNewNode(); tmp->data = value; if(head == NULL){ head = tmp; } else{ p = head; while(p->next !...

January 2, 2019 · 1 min · Rahul Rajput

Blackjack Console game program in Python

Blackjack Game Blackjack is the American variant of a globally popular banking game known as Twenty-One. Game Rules One player have to make the total sum of his hands lower than 21 to win while another player has the total sum is 21 or more, Cards greater than or equal to 10 are considered as the 10, Ace can be considered as the 11 or 1 depending on conditions. Person who scored less will be announced as winner, considering there must be one person whose score should be more than 21....

December 26, 2018 · 3 min · Rahul Rajput

File Handling in C (Reading a file line by line)

In this tutorial, we are working with the files in the C. File handling in any language requires Three main steps to follow Open the file in Read/Write mode. Do various operation that you want to do. Close the file. We are using fopen(file stream). There are some modes to open a file. Read mode opens file into the read mode if file not found returns -1. Write mode opens file into the write mode if the file does not present creates a new file if there is previous data it will be overwritten....

December 18, 2018 · 2 min · Rahul Rajput

Bascis of Pointers In C language

A pointer is a variable which contains the address of the variable specified. For example: int x = 100; int *data; data = &x; This variable data contains the address of the block in the memory which contains the value 100. * specifies that this is the pointer variable. & gives the address. that is the what I am doing here assigning the address of the integer variable x to the pointer variable data....

December 18, 2018 · 3 min · Rahul Rajput

Finding Length of an Array in C

Array in C an array is a collection of a variable of a fixed number of the same data type in a sequential memory. an array can be declared in various ways. one of them is given below int x[] = {200,300,522,655}; char y[] = {'x','s','r'}; int n[10],j; // first declaring the array // then assigning the value. for ( j = 0; j < 10; j++ ) { n[ j ] = j + 100; } indexing in C array starts from the 0....

December 18, 2018 · 2 min · Rahul Rajput

C/C++ program to check the Palindrome string.

Palindrome string: A string or word which are same from the start and end means word or program which look like same as original and reversed. To do that we have to first reverse the string. Check out our post on the String reverse in C/C++. To write the program of the Palindrome steps used are. Get the input from the user. convert the string to the Lower case to avoid any case sensitivity....

December 17, 2018 · 3 min · Rahul Rajput