Server Side Programming Articles

Page 930 of 2109

How to print a name multiple times without loop statement using C language?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 8K+ Views

In C programming, printing a name multiple times typically requires loops. However, we can achieve this without using any loop or goto statement by implementing recursive functions or using multiple printf statements. Syntax void recursiveFunction(parameters) { // Base case if (condition) return; // Process printf("text"); // Recursive call recursiveFunction(modified_parameters); } Method 1: Using ...

Read More

Find the ASCII value of the uppercase character 'A' using implicit conversion in C language?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 600 Views

Implicit type conversion occurs when the compiler automatically converts a smaller data type to a larger data type without explicit casting. In C, when a char is used in an arithmetic operation, it gets implicitly converted to an int, allowing us to access its ASCII value. Syntax int ascii_value = character + 0; // Implicit conversion from char to int Example 1: ASCII Value of 'A' The following example demonstrates finding the ASCII value of uppercase character 'A' using implicit conversion − #include int main() { ...

Read More

What are the 4 steps to convert C program to Machine code?

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 5K+ Views

Converting a C program to machine code is a multi-stage process that transforms human-readable source code into executable machine instructions. This process involves four essential steps that work together to create a runnable program. The 4 Steps to Convert C Program to Machine Code The conversion process follows these four sequential steps − Writing and Editing − Creating the source code Preprocessing − Processing directives and preparing code Compiling − Translating to machine language Linking − Creating the final executable Source Code (.c) ...

Read More

Significance of Lambda Function in C/C++

Dev Prakash Sharma
Dev Prakash Sharma
Updated on 15-Mar-2026 4K+ Views

Lambda Function − Lambda functions are anonymous inline functions that don't require any implementation outside the scope where they are defined. They provide a concise way to write small functions directly at the point of use. Lambda functions can also be stored in variables and treated as objects that can be called (called functors). When the compiler encounters a lambda function definition, it creates a custom object for that lambda. Note: Lambda functions are a C++11 feature and are NOT available in C. They are part of the C++ standard, not C. In C programming, you would use ...

Read More

Maximum distinct lines passing through a single point in C

Sunidhi Bansal
Sunidhi Bansal
Updated on 15-Mar-2026 301 Views

In computational geometry, finding the maximum number of distinct lines passing through a single point is a common problem. Given N lines defined by pairs of coordinates (x1, y1) and (x2, y2), we need to find how many lines with different slopes can pass through a single point. Syntax int maxDistinctLines(int n, int x1[], int y1[], int x2[], int y2[]); Approach We represent each line using the slope formula y = mx + c, where m is the slope calculated as − For non-vertical lines: slope = (y2 - y1) / (x2 ...

Read More

Maximum given sized rectangles that can be cut out of a sheet of paper in C

Sunidhi Bansal
Sunidhi Bansal
Updated on 15-Mar-2026 535 Views

We are given the dimensions of a sheet of paper, its Length L and Breadth B. Also, we are given the dimensions of a smaller rectangle, its length l and breadth b. The goal is to find the maximum number of smaller rectangles that can be cut out of the sheet of paper. We will follow these steps − First, try horizontal alignment: divide the sheet length L by rectangle length l, and sheet breadth B by rectangle breadth b, then multiply to get the count. Then try vertical alignment (rotate the rectangle 90°): divide sheet length ...

Read More

Maximum number of candies that can be bought in C

Sunidhi Bansal
Sunidhi Bansal
Updated on 15-Mar-2026 906 Views

We are given an array of candies[] of length stored in 'size'. Each element candies[i] has a number for candies of type i. The goal is to buy as many candies as possible for any amount of money. The conditions are as given − If you purchase X[i] of type i (0

Read More

Maximum number of 2×2 squares that can be fit inside a right isosceles triangle in C

Sunidhi Bansal
Sunidhi Bansal
Updated on 15-Mar-2026 1K+ Views

We are given a right isosceles triangle where we need to find the maximum number of 2×2 squares that can fit inside it. An isosceles triangle has two sides of equal length, and in a right isosceles triangle, the base and height are perpendicular and equal to each other. Base Height The key insight is that from the corner triangular areas, we need to subtract ...

Read More

Count number of 1s in the array after N moves in C

Sunidhi Bansal
Sunidhi Bansal
Updated on 15-Mar-2026 523 Views

We are given an array of size N. The array has all 0's initially. The task is to count the number of 1's in the array after N moves. Each Nth move has a rule associated with it − 1st Move − Change element at positions 1, 2, 3, 4... 2nd Move − Change element at positions 2, 4, 6, 8... 3rd Move − Change element at positions 3, 6, 9, 12... In each move, we flip the elements (0 becomes 1, 1 becomes 0) at the specified positions. Let's understand with examples. Syntax ...

Read More

Maximum binomial coefficient term value in C

Sunidhi Bansal
Sunidhi Bansal
Updated on 15-Mar-2026 335 Views

In C, finding the maximum binomial coefficient term for a given positive integer 'N' involves calculating all binomial coefficients nCr and determining the largest value among them. The binomial coefficient series is nC0, nC1, nC2, ..., nCr, ..., nCn-2, nCn-1, nCn. Syntax nCr = n! / (r! * (n - r)!) For N=4: 4C0=1, 4C1=4, 4C2=6, 4C3=4, 4C4=1. Maximum coefficient is 6. For N=5: 5C0=1, 5C1=5, 5C2=10, 5C3=10, 5C4=5, 5C5=1. Maximum coefficient is 10. Method 1: Using Pascal's Triangle Approach This method builds Pascal's triangle using dynamic programming to calculate binomial ...

Read More
Showing 9291–9300 of 21,090 articles
« Prev 1 928 929 930 931 932 2109 Next »
Advertisements