Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by sudhir sharma
Page 9 of 98
Breaking the Noise Barrier: Maximum Data Rates for Noisy and Noiseless Channels
The maximum data rate or channel capacity determines how much information can be transmitted through a communication channel without errors. Understanding the fundamental limits imposed by both noiseless and noisy channel conditions is essential for designing efficient communication systems. Two key theorems define these limits: the Nyquist theorem for noiseless channels and Shannon's theorem for noisy channels. Both provide mathematical foundations for calculating maximum achievable data rates under different conditions. Maximum Data Rate for Noiseless Channels In a noiseless channel, the maximum data rate is limited only by the bandwidth and the number of discrete signal levels ...
Read MoreAdvanced JavaScript Backend Basics
JavaScript is a lightweight, interpreted programming language primarily used for web development. Each browser has its own JavaScript engine that enables proper code execution. Common browsers and their JavaScript engines include: SpiderMonkey for Firefox V8 for Google Chrome JavaScriptCore for Safari Chakra for Microsoft Internet Explorer/Edge To standardize JavaScript across browsers, the ECMA (European Computer Manufacturers Association) sets official standards for the language. How JavaScript Engine Works JavaScript engines execute code in two distinct phases to ensure proper functionality across all browsers: ...
Read MoreAsynchronous Functions and the Node Event Loop in Javascript
Asynchronous functions allow programs to continue executing without waiting for time-consuming operations to complete. This non-blocking behavior is fundamental to JavaScript and Node.js, enabling better user experience and efficient resource utilization. When executing expensive operations like network requests or file I/O, asynchronous functions prevent the entire program from freezing. Instead of blocking execution, these operations run in the background while other code continues to execute. Understanding Asynchronous Execution In synchronous programming, each operation must complete before the next one begins. Asynchronous programming allows multiple operations to run concurrently, with callbacks or promises handling completion. console.log('One'); ...
Read MoreThe Ultimate Guide to Mastering Ping in C Programming: Basics, Commands, and Troubleshooting
In C programming, implementing a ping utility involves creating ICMP (Internet Control Message Protocol) echo request packets and analyzing the responses. Ping is a fundamental network diagnostic tool that helps test connectivity, measure latency, and troubleshoot network issues. Syntax #include #include #include int socket(int domain, int type, int protocol); int sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); How Ping Works Ping operates by sending ICMP echo request packets to a ...
Read Morefopen() for existing file in write mode in C
The fopen() function in C is used to open files for various operations. When opening an existing file in write mode, it's important to understand how different modes affect the file's content. Syntax FILE *fopen(const char *filename, const char *mode); fopen() for an Existing File in Write Mode When using fopen() with write mode on an existing file − 'w' mode: Creates a new file if it doesn't exist, or truncates (empties) an existing file before writing 'w+' mode: Same as 'w' but allows both reading and writing 'a' mode: Appends new ...
Read MoreBitwise recursive addition of two integers in C
In this problem, we are given two numbers. Our task is to create a C program for the bitwise recursive addition of two integers. The logic to find the sum using bitwise operations is similar to manual addition we learned in school. For finding the sum, we add each digit and if a carry is generated, we add it to the next digit position. We will use the XOR operator to find the sum and the AND operation to check for carry. If there is a carry, we recursively add it back to the result. This is the ...
Read MoreC Programming Language Standard
In this article, we will learn about the standards defined in the C programming language. These standards specify how programs should be compiled and executed as defined by the development community. To understand this concept, let's examine a common C program that demonstrates standard compliance issues − What is the C Programming Language Standard? The C programming language standard defines the official specification for how C compilers should behave. It establishes the correct syntax, semantics, and behavior of C programs. The latest C standard is ISO/IEC 9899:2018, also known as C18, which was released in June 2018. ...
Read MoreC program to store Student records as Structures and Sort them by Name
In this problem, we are given a student's record which contains student_id, student_name, and student_percentage. Our task is to create a C program to store student records as structures and sort them by name using string comparison. Syntax struct Student { int student_id; char student_name[50]; int student_percentage; }; int qsort(void *base, size_t nitems, size_t size, int (*compar)(const void *, const void*)); Example Input and Output Input − student record − { student_id = 1, student_name = Nupur, student_percentage = ...
Read MoreC program to simulate Nondeterministic Finite Automata (NFA)
In this problem, we will create a C program to simulate Non-deterministic Finite Automata (NFA). NFA is a finite state machine that can move to any combination of states for an input symbol, meaning there is no exact state to which the machine will move. Syntax struct node { int data; struct node* next; char edgetype; }; int nfa(node** graph, int current, char* input, int* accept, int start); Formal Definition of NFA NFA can be represented by 5-tuple (Q, Σ, δ, ...
Read MoreC Program to reverse each node value in Singly Linked List
In this article, we are given a singly linked list. Our task is to create a C program to reverse each node value in the linked list − meaning if a node contains 123, it should become 321. A singly linked list is a linear data structure where each node contains data and a pointer to the next node in the sequence. Problem Example Input: 34 → 12 → 89 → 56 → 72 Output: 43 → 21 → 98 → 65 → 27 Approach To solve this problem, we will: Traverse each ...
Read More