Skip to content
  • Home
  • Algorithms
  • DS
  • Salesforce
  • Courses
    • C Programming
    • Data Structures with C/C++
    • Algorithms and Interview questions
    • ACCOUNTS
      • TALLY ERP9 Course Structure
  • Submit your article
Search
Close

Tag: C Programming

Given two linked lists, both represent a number need to find its sum linked list.

GalleryJuly 18, 2020July 18, 2020 KodeBinary

As described in problem statement, we have two linked lists represents as decimal numbers. We aim to find its sum as a linked list. Let us understand this with an example. We can solve this problem in two different ways. Digit by digit sum calculation. Converting a list to the number and calculate the sumRead More »

Calculating the Sum of Digits Easily with Recursion and Iteration

GalleryJuly 12, 2020January 20, 2023 KodeBinary

To obtain the sum of the digits in an input number, we can use the modulus operator (with 10) to divide each digit and add the results together. Let’s explore this concept with an example. We can solve this problem both iteratively and recursively; let’s take a look at the code for both methods. RecursiveRead More »

Find the number of occurrences of the given input in a linked list.

GalleryJune 21, 2020June 20, 2020 KodeBinary

We are given a linked list of integers and an integer, which we want to calculate occurrences. We aim to find the count of events of the object in the linked list. To find the count of occurrences, we simply iterate over each item and checks if the current thing is equivalent to the givenRead More »

Find the number of capital letters in a file

GalleryJune 10, 2020June 20, 2020 KodeBinary

As a first step to solve this problem, we need to have a file descriptor with a read (“r”) mode to read the contents of the file. In this problem, we need to read each character and need to check if that character is in capital letter boundary (i.e., between ‘A’ to ‘Z’). If so,Read More »

Data types in C Programming

GalleryJune 9, 2020June 20, 2020 KodeBinary

A Data Type in C is a metadata that represents the program data, which also tells the compiler or interpreter about the data. These data types also defines all its proper operations on corresponding data. Every variable that we use in the C Program created with specific data types. Based on the type of dataRead More »

Arrays in C (definition and initialization)

GalleryMay 31, 2020May 31, 2020 KodeBinary

Array is a data type to store similar types of elements in contiguous memory segments, pictorial representation of arrays is as shown below. Above array of 7 integers represents with variable “a” is {1, 5, 1, 2, 6, 8, 3} starts at address 1000. In a 32bit machine size of an integer value is 4bytesRead More »

How to find merge point of two linked lists

GalleryMarch 28, 2020May 10, 2020 KodeBinary

Let us take two linked lists which at some point merge as one list. Our goal is to find the point where the given two linked lists merging. The most optimized solution for this problem is to find the maximum length list and jump each node until both lists length becomes the same. Below isRead More »

C Program without main function

GalleryFebruary 26, 2020May 10, 2020 KodeBinary

Every C program starts with an implicit function _start(), which calls the function main implicitly. If we don’t provide function “main” in the C program, the compiler throws “_main” undefined symbol from entry error. Any program written in C should provide the main function to compile it properly. We can write a hack before preprocessorRead More »

C program to dynamically allocate two-dimensional memory (arrays)

GalleryFebruary 15, 2020May 13, 2020 KodeBinary

Allocating dynamic memory using malloc & calloc is a basic functionality of any C program. Whereas allocating a 2D dynamic memory is a complex task to C beginners. Here in this article, we will see how to allocate memory for a two-dimensional integer pointer using malloc. First of all let us write a simple 2×3Read More »

C program to get the number of lines of a file

GalleryFebruary 15, 2020June 10, 2020 KodeBinary

One of the fundamental databases for C programming is Files (IO). In this article we are going to count the number of lines in a given file. Function reads the FILE pointer as an input argument and returns the count of lines in the given file pointer. To finish this requirement we are going toRead More »

how sizeof operator works in C

GalleryFebruary 4, 2020May 13, 2020 KodeBinary

sizeof operator is one of the most useful C operators to find the size of any operator or variable in bytes. This usually takes the difference between the next and current address of the given variable. To understand this in a better way, let us take a variable array with 5 elements. Now, lets printRead More »

C program to convert file contents to upper case

GalleryFebruary 1, 2020May 15, 2020 KodeBinary

Given a file with all types of characters. Our aim here is to convert file contents into their upper case. Let us take below example program file and convert its content to capital letters. Our program should convert this file as shown below. To solve this problem, we need to have a temporary file thatRead More »

Sort binary array (contain 0s and 1s) in best complexity (O(n))

GalleryFebruary 1, 2020May 15, 2020 KodeBinary

Given an array of binary (0 or 1) numbers, we aim to sort that binary array in ascending order with minimum possible complexity. Let us take the below example requirement. We can sort these binary elements iteratively. In every iteration we swap left-most “1” with rightmost “0”. This iteration continuous until right most “0” indexRead More »

Display contents of a file in reverse orders using C

GalleryJanuary 29, 2020June 10, 2020 KodeBinary

This article demonstrates how to get all characters in a text file in reverse order using the C program. Let us take below the example text input file and expected outputs. Our C program should display the above file in reverse order as shown below. Let’s write the C program to solve the above requirement.Read More »

Memory layout of a C Program

GalleryDecember 29, 2019May 15, 2020 KodeBinary

Before we start learning C programming, it is good to understand how the memory of a C program organizes. Every C program contains five types of memory in it. TEXT/CODE Segment. DATA Segment. UNINITIALIZED DATA (B SS) Segment. HEAP Segment. STACK Segment. These memory segments from top to bottom arranged from low memory to highRead More »

Posts navigation

Older Posts

Subscribe to KodeBinary

Enter your email address to subscribe KodeBinary and receive notifications of new posts by email.

Join 1,773 other subscribers

Recent Posts

  • Find the sum of the largest increasing branch in an n-ary tree
  • The fizzbuzz program in python
  • Python program to add two numbers
  • Program to find factorial of a number in python
  • Armstrong number in python

Our Partners

Home, Car Loan EMI Calculator

Categories

  • accounts
  • Algorithms
  • autoCAD
  • C
  • C++
  • COVID 19
  • DS
  • HTML
  • Java
  • ms office
  • Python
  • Salesforce
  • TALLY
  • Tally Prime
  • Uncategorized

Tags

Accounts Algorithms Amazon Ancillary Rules Arrays assignment bill of materials Binary Search Tree C++ company contra voucher cost categories cost centers C Programming DataStructures debit Dynamic Programming Graphs GROUPS groups and ledgers gst Interview Questions INVENTORY ledgers Linked List Microsoft payment voucher Purchase Python Queue Quiz receipt voucher Recursion sales Sorting Stack STOCK ITEMS Strings tally tallyerp9 tally prime TALLY WITH GST Trees Voucher vouchers

Follow Us

  • Facebook
  • Tumblr
  • Instagram
  • LinkedIn
  • Twitter
Copyrights 2019 | KodeBinary.com.
Back to top