Bhanu Priya has Published 1581 Articles

C program to represent the alphabets in spiral pattern

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:44:06

181 Views

The spiral pattern to represent the alphabets is as follows −The logic used to represent the alphabets in spiral model is as follows −if(rows=1){    for(i=1;i

C program to add all perfect square elements in an array.

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:42:51

2K+ Views

ProblemWrite a program to find the sum of perfect square elements in an array.Given a number of elements in array as input and the sum of all the perfect square of those elements present in the array is output.SolutionFor example, Input= 1, 2, 3, 4, 5, 9, 10, 11, 16 ... Read More

C program to represent the numbers in spiral pattern

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:41:25

1K+ Views

The spiral pattern to represent the numbers is shown below −The logic applied to print the numbers in spiral pattern is as follows −for(i=1;i

C program to find array type entered by user using pointers.

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:39:56

479 Views

ProblemWrite a C Program to find the array type that we need to check, whether the given elements in an array are even numbers or odd numbers or combination of both by using pointers.SolutionThe user has to enter an array of integers, then, display the type of the array.Example 1 ... Read More

C Program to display the numbers in X pattern

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:37:30

2K+ Views

Refer an algorithm given below for the C program to display the numbers in X pattern.AlgorithmStep 1: Start Step 2: Declare variables Step 3: Read number of rows Step 4: for loop satisfiesif(i==j || i+j==rows-1)print i+1Print " "Step 5: Print new line Step 6: StopThe logic to print numbers in ... Read More

C program to find type of array entered by the user.

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:34:34

640 Views

ProblemWrite a C Program to find the array type which we need to check, whether the given elements in an array are even numbers or odd numbers or combination of both.SolutionSo, user has to enter an array of integers, then, display the type of the array.Example 1 − Input: 5 ... Read More

C program to explain the goto statement

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:33:46

732 Views

The C program evaluates the square root for five numbers. The variable count stores the count of numbers read. When count is less than or equal to 5, goto read statement directs the control to the label read. Otherwise, the program prints a message and stops.Goto statementIt is used after ... Read More

C program for testing the character type

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:33:20

906 Views

There are some predefined functions available in "ctype.h" library for analyzing the character input and converting them.Analysis FunctionsThe character analysis functions are listed below −FunctionChecks whether entered character isisalphaAn alphabet (or) notisdigitA digit (or) notisspace QA space, a newline (or) tabispunct (A special symbol (or) notislowerA lower case letter of ... Read More

C Program to check the type of character entered

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:32:19

6K+ Views

Write a program to find out that a given character is upper case, lower case, number or special character.SolutionIf an entered character is capital letter then, it displays the upper case.Example: Input =H Output: upper case letterIf an entered character is small letter then, it displays the lower case letter.Example: ... Read More

C program to convert days into months and number of days

Bhanu Priya

Bhanu Priya

Updated on 26-Mar-2021 07:31:10

9K+ Views

User has to enter total number of days. We need to convert the total number of days into months and left-over days in coming month.The formula to convert days into months is as follows −          Month=days/30The logic to find left-over days for the coming month is ... Read More

Advertisements