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
C Articles
Page 45 of 96
bar() 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 MoreC Program for product of array
Given an array arr[n] of n number of elements, the task is to find the product of all the elements of that array. Like we have an array arr[7] of 7 elements so its product will be like − a[0] a[1] a[2] ... a[n-1] × × × × Product = a[0] × a[1] × a[2] × ... × a[n-1] ...
Read MoreC Program for Arrow Star Pattern
In C programming, an arrow star pattern is a visual pattern that resembles an arrow shape using asterisk (*) characters. The pattern consists of two parts: an upper section that decreases in width and a lower section that increases in width, creating an arrow-like appearance. Syntax void printArrowPattern(int n); Algorithm The arrow pattern generation follows these steps − Upper Part: Print decreasing number of stars with increasing leading spaces Lower Part: Print increasing number of stars with decreasing leading spaces Use nested loops to control spaces and stars for each row ...
Read MoreC Program to check if a number is divisible by sum of its digits
Given a number n we have to check whether the sum of its digits divide the number n or not. To find out we have to sum all the numbers starting from the unit place and then divide the number with the final sum. Like we have a number "521" so we have to find the sum of its digit that will be "5 + 2 + 1 = 8" but 521 is not divisible by 8 without leaving any remainder. Let's take another example "60" where "6+0 = 6" which can divide 60 and will not leave ...
Read MoreC Program to check if the points are parallel to X axis or Y axis
Given n number of points we have to check that whether the point is parallel to x-axis or y-axis or no axis according to a graph. A graph is a figure which is used to show a relationship between two variables each measured along with axis at right angles. Parallel are the same lines which are having same distance at all points, like railway tracks are parallel to each other. So, we have to find whether the points are parallel to x-axis or y-axis means the distance between the coordinates and the axis are same at all points. ...
Read MoreC Program for replacing one digit with other
Given a number n, we have to replace a digit x from that number with another given number m. We have to look for the number whether the digit is present in the given number or not, if it is present in the given number then replace that particular digit x with another digit m. Like we are given with a number "123" and m as 5 and the digit to be replaced i.e. x as "2", so the result should be "153". Syntax int digitReplace(int n, int digit, int replace); Algorithm The ...
Read More