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
Programming Articles
Page 962 of 2547
C Program to calculate the Round Trip Time (RTT)
Round Trip Time (RTT) is the time required to send a network request to a server and receive a response back. In C programming, we can calculate RTT by measuring the time before and after making a network request or system call. Syntax #include clock_t start_time = clock(); // Network operation or system call clock_t end_time = clock(); double rtt = ((double)(end_time - start_time)) / CLOCKS_PER_SEC; What is Round Trip Time? Round Trip Time (RTT) consists of − Transmission time − Time to send the request Propagation delay − Time for ...
Read MoreC Program to Change RGB color model to HSV color model
Given RGB color range in form of integers; the task is to find its appropriate HSV color by converting the RGB color range. This conversion helps translate between the hardware-oriented RGB model and the more intuitive HSV model used in graphics and design applications. What is RGB Color Model RGB color model comprised of three colors Red, Green and Blue. RGB model is a color model which is widely used in the display technologies; it is an additive model in which we add these three colors with different intensities to produce millions of different colors on a display ...
Read MoreC Program to convert a given number to words
In C programming, converting numbers to words is a common problem that involves breaking down a number into its place values and mapping each digit to its corresponding word representation. This program converts numbers from 0 to 9999 into their English word equivalents. Syntax void convert(char *num); Algorithm Overview The conversion process involves these key steps − Parse the input string to determine its length Use arrays to store word representations for different place values Process digits from left to right based on their position Handle special cases for numbers 10-19 and ...
Read MorePrinting all subsets of {1,2,3,...n} without using array or loop in C program
Given a positive integer n, we have to print all the subsets of the set {1, 2, 3, 4, … n} without using any array or loops. For example, if n = 3, we need to print all subsets of {1, 2, 3} which are {1 2 3}, {1 2}, {2 3}, {1 3}, {1}, {2}, {3}, and { }. Since we cannot use loops or arrays, recursion is the only way to solve this problem. We use binary representation to generate subsets efficiently. Syntax void generateSubsets(int n, int currentNum); void printSubset(int bitPosition, int num, int ...
Read MoreBash program to check if the Number is a Prime or not
A prime number is a natural number greater than 1 that has exactly two factors: 1 and itself. Examples include 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, etc. In this article, we'll write a C program to check if a given number is prime or not. Syntax for (i = 2; i
Read Morebar() function in C graphics
The bar() function in C graphics is used to draw a filled rectangular bar. It is defined in the graphics.h header file and is commonly used for creating bar charts and filled rectangular shapes in graphics programming. Syntax void bar(int left, int top, int right, int bottom); Parameters left − X-coordinate of the top-left corner top − Y-coordinate of the top-left corner right − X-coordinate of the bottom-right corner bottom − Y-coordinate of the bottom-right corner How It Works ...
Read MoreBands in Radio frequency Spectrum in C program
Radio frequency (RF) is the oscillation of an A.C. current or voltage in the frequency range of 20KHz to 300 GHz. In C programming, we can create programs to classify and work with different RF bands. Radio frequency spectrum is divided into bands − frequency ranges used for specific applications. Each band has distinct characteristics, propagation methods, and uses in communication systems. Syntax // Basic structure for RF band classification if (frequency >= min_freq && frequency = 3000 && freqHz = 30000 && freqHz = 300000 && freqHz = 3000000 && freqHz = 30000000 && freqHz = 300000000 && freqHz = 3000000000 && freqHz = 30000000000 && freqHz
Read MoreIntroduction to Backtracking
Backtracking is a systematic technique for solving computational problems by exploring all possible solutions incrementally and abandoning paths that cannot lead to a valid solution. It uses recursive calling to build solutions step by step, removing invalid solutions based on problem constraints. Types of Backtracking Problems Backtracking algorithm is applied to three main types of problems − Decision problems − Find any feasible solution Optimization problems − Find the best solution among all feasible solutions Enumeration problems − Find all feasible solutions to the ...
Read MoreMCQ on Memory allocation and compilation process in C
Here we will see some MCQ questions on Memory Allocation and Compilation Processes in C programming language. Question 1: Union Memory Allocation What will be the output of the following code − #include #include int main() { union my_union { int i; float f; char c; }; union my_union* u; u = (union ...
Read MoreC Program to check if a number is divisible by any of its digits
Given a number n, the task is to find if any digit in the number divides the number completely. For example, the number 128625 is divisible by 5, which is also present in the number. Syntax int isDivisibleByDigit(long long int n); Algorithm The approach used is as follows − Extract each digit from the number using modulo operation Check if the original number is divisible by that digit If divisible, return true; otherwise continue with the next digit Remove the last digit by dividing the number by 10 Repeat until all digits ...
Read More