Server Side Programming Articles

Page 912 of 2109

C Program to print all ASCII values.

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

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numeric values to characters. In C programming, we can print ASCII values of characters using format specifiers without explicitly converting characters to integers. Syntax printf("%c \t %d", i, i); Method 1: Printing ASCII Values from A to z (65 to 122) This example prints ASCII values for uppercase letters, special characters, and lowercase letters − #include int main() { int i; printf("Character \t ASCII Value"); // Print ASCII values from A to z for (i = 65; i = 32 && i

Read More

C program to remove spaces in a sentence using string concepts.

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

In C, removing spaces from a string involves iterating through the string and eliminating space characters. This can be accomplished using string manipulation techniques where we shift characters to overwrite spaces. Syntax while(string[i] != '\0') { if(string[i] == ' ') { // Shift characters left to remove space } i++; } String Declaration and Initialization An array of characters is called a string. Given below is the declaration of a string − ...

Read More

Deletion of head and tail element logic in a linked list using C language.

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

In C programming, deleting head and tail elements from a linked list are fundamental operations that require careful pointer manipulation to maintain list integrity. A linked list is a dynamic data structure where each node contains data and a pointer to the next node. Syntax // Delete head node void deleteHead(); // Delete tail node void deleteTail(); Node Structure First, let's define the basic node structure for our linked list − Data Next Node Structure ...

Read More

Explain the pointers for inter-function communication in C language.

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

Pointers enable inter-function communication in C by allowing functions to modify variables in the calling function's scope. This is essential for pass-by-reference behavior and returning multiple values from a single function. Syntax // Function declaration with pointer parameters return_type function_name(data_type *pointer_param); // Function call passing address function_name(&variable); Key Concepts Pass-by-value: Function receives a copy of the variable's value Pass-by-reference: Function receives the address of the variable using pointers Multiple return values: Use pointers to modify multiple variables in the calling function Example: Returning Multiple Values The following program demonstrates ...

Read More

Explain scope of a variable in C language.

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

In C programming, the scope of a variable defines where in the program that variable can be accessed or referenced. Variable scope determines the visibility and accessibility of variables throughout different parts of your program. Syntax // Global scope data_type variable_name; int main() { // Local scope data_type variable_name; return 0; } Types of Variable Scope C language supports two main types of variable scope − Local Scope: Variables declared inside a function or block are only accessible within ...

Read More

C program for Addition and Multiplication by 2 using Bitwise Operations.

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

Bitwise operators in C operate directly on bits (binary representation) of operands. They are highly efficient for arithmetic operations like multiplication and division by powers of 2. The left shift () operators can perform these operations faster than traditional arithmetic operators. Syntax // Multiplication by 2 result = number > 1; Bitwise Operators Overview Operator ...

Read More

C program to print area of triangle, square, circle, rectangle and polygon using switch case.

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

This C program calculates the area of different geometric shapes using a switch case statement. The program provides a menu−driven interface where users can select from triangle, square, circle, rectangle, and parallelogram area calculations. Syntax switch (expression) { case constant1: // statements break; case constant2: // statements break; default: ...

Read More

Write a C program for guessing the number game.

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

A number guessing game is a classic programming exercise where the computer has a secret number and the user must guess it. The program provides hints after each guess, telling whether the guess is too high or too low, until the correct number is found. Syntax do { if (guess == secretNumber) { // Correct guess - exit loop } else if (guess < secretNumber) { // Give "too low" hint ...

Read More

C program to count a letter repeated in a sentence.

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

In C programming, counting the frequency of a specific character in a string is a common task. This program prompts the user to enter a sentence and a character, then counts how many times that character appears in the sentence using strlen() function for string length determination. Syntax for(i = 0; i < strlen(string); i++) { if(string[i] == character) { count++; } } Algorithm The logic to count character frequency involves the following steps − Read ...

Read More

What is C unconditional jump statements?

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

C programming language provides unconditional jump statements that allow transferring control from one part of the program to another without evaluating any condition. The four main unconditional jump statements are break, continue, return, and goto. break Statement The break statement is used to terminate loops or exit from switch blocks immediately. When executed, control jumps to the statement following the loop or block. Syntax break; Example The following program demonstrates the break statement in a loop − #include int main() { int i; for (i = 1; i

Read More
Showing 9111–9120 of 21,090 articles
« Prev 1 910 911 912 913 914 2109 Next »
Advertisements