Bhanu Priya has Published 1581 Articles

C program to remove extra spaces using string concepts.

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 08:32:55

5K+ Views

ProblemRemove all the extra spaces from an entered string at runtime with the help of while loop by checking the spaces at each index of a character.SolutionConsider an example given below −It removes all the spaces from a given string. The given string is Tutorials Point C Programming. The result ... Read More

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

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 08:29:22

3K+ Views

ProblemRemove all the spaces from an entered string at runtime with the help of while loop by checking spaces at each index of a character.SolutionConsider an example given below −It removes all the spaces from a given string. The given string is Tutorials Point C Programming. The result after removing ... Read More

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

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 08:26:11

388 Views

Linked lists use dynamic memory allocation i.e. they grow and shrink accordingly. It is collection of nodes.Node has two parts, which are data and link. These are explained below.Operations on linked listsThere are three types of operations on linked lists which are as follows −InsertionDeletionTraversingDeletionIdentify the node.Adjust the links in ... Read More

Explain scope of a variable in C language.

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 08:09:05

733 Views

Storage classes specify the scope, lifetime and binding of variables.To fully define a variable, one needs to mention not only its ‘type’ but also its storage class.A variable name identifies some physical location within computer memory, where a collection of bits are allocated for storing values of variable.Storage class tells ... Read More

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

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 08:06:05

865 Views

Bitwise operators operate on bits (i.e. on binary values of on operand)OperatorDescription&Bitwise AND|Bitwise OR^Bitwise XORRight Shift-One's complementBitwise ANDaba & b000010100111Bitwise ORaba | b000011101111Bitwise XORaba ^ b000011101110ExampleFollowing is the C program for addition and multiplication by 2 with the help of bitwise operators − Live Demo#include main(){    int a;    printf("Enter ... Read More

Write a C program for guessing the number game.

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 07:29:28

1K+ Views

ProblemIn a program a number is already initialized to some constant. Here, we have to ask the user to guess that number which is already in the program. For this, we need to provide some clues for every time the user entering the number.SolutionThe logic that is used to guess ... Read More

C program to count a letter repeated in a sentence.

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 07:24:11

5K+ Views

ProblemWrite a program to count a letter, which is entered by the user at console. How many times that letter is repeated in a sentence need to be printed on screen by using strlen() function.SolutionThe logics we used to count a letter are as follows −Asking the user to enter ... Read More

What is C unconditional jump statements?

Bhanu Priya

Bhanu Priya

Updated on 25-Mar-2021 07:20:59

9K+ Views

C programming language allows jumping from one statement to another. It also supports break, continue, return and go to jump statements.breakIt is a keyword which is used to terminate the loop (or) exit from the block.The control jumps to next statement after the loop (or) block.break is used with for, ... Read More

Convert vowels from upper to lower or lower to upper using C program

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 14:29:19

1K+ Views

An array of characters is called a string.DeclarationFollowing is the declaration for an array −char stringname [size];For example − char a[50]; string of length 50 charactersInitializationUsing single character constant −char a[10] = { ‘H’, ‘e’, ‘l’, ‘l’, ‘o’ ,‘\0’}Using string constants −char a[10] = "Hello":;AccessingThere is a control string "%s" ... Read More

C Program to print the sum of boundary elements of a matrix

Bhanu Priya

Bhanu Priya

Updated on 24-Mar-2021 14:28:37

5K+ Views

Given a matrix, we need to print the boundary elements of the matrix and display their sum.ExampleRefer the matrix given below −Given matrix1 2 3 4 5 6 7 8 9Boundary Matrix1 2 3 4   6 7 8 9Sum of boundary elements: 1 + 2 + 3 + 4 + 6 + 7 + 8 + 9 = 40The logic to find the sum of boundary matrix is as follows −for(i = 0; i

Advertisements