Bhanu Priya

Bhanu Priya

1,060 Articles Published

Articles by Bhanu Priya

Page 8 of 106

C Program to check the type of character entered

Bhanu Priya
Bhanu Priya
Updated on 11-Mar-2026 9K+ 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: Input= g Output: lower case letterIf an entered character is number then, it displays the digit.Example: Input=3 Output: digitIf an entered character is a special character then, it displays the special character.Example: Input= & Output: special characterAlgorithmRefer an algorithm given below to find out that a given character is upper ...

Read More

Explain the concept of one and two dimensional array processing using C language

Bhanu Priya
Bhanu Priya
Updated on 11-Mar-2026 661 Views

Let us first understand the one dimensional array processing in C programming language.1D Array ProcessingStoring values in 1 D Array(reading) is done as follows −int num[5] int i; for(i=0;i

Read More

C program to convert days into months and number of days

Bhanu Priya
Bhanu Priya
Updated on 11-Mar-2026 13K+ 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 as follows −          Days=days %30AlgorithmRefer an algorithm given below to convert days into months and number of days.Step 1: Start Step 2: Declare month and days Step 3: Read total number of days Step 4: Compute months    months=days/30 Step 5: Compute days    Days= days ...

Read More

C program for testing the character type

Bhanu Priya
Bhanu Priya
Updated on 11-Mar-2026 1K+ 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 alphabetisupper QAn upper case letter of alphabetisalphanumericAn alphabet/digit or notConverting FunctionsThe converting functions are listed below −FunctionConversiontolower()Converts an upper case alphabet to lower casetoupper QConverts a lower case alphabet to upper caseProgramFollowing is the C program for character analysis and conversion functions which are used to test the character type ...

Read More

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

Bhanu Priya
Bhanu Priya
Updated on 11-Mar-2026 983 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 3 1, Output: odd array.Example 2 − Input: 2 4 6 8, Output: even array.Example 3 − Input: 1 2 3 4 5, Output: mixed array.AlgorithmRefer an algorithm given below to find the array type entered by the user.Step 1 − Read the size of array at runtime.Step 2 − ...

Read More

Explain nested switch case in C language

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

ProblemWrite a C program to check the entered password by the user is valid or not based on his/her ID using nested switch case.SolutionThe solution is explained below −In C language, we can write inner switch which is placed in an outer switch.The case values of the inner and outer switch can have common values.RulesAn expression executes to a result.Constants and unique values must be used for case labels.Case labels has to be end with a colon ( : ).A break keyword has to be included in each case.There can be only one default label.We can write nested multiple switch ...

Read More

What is a two-dimensional array in C language?

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

An array is a group of related items that store with a common name.SyntaxThe syntax is as follows for declaring an array −datatype array_name [size];Types of arraysArrays are broadly classified into three types. They are as follows −One – dimensional arraysTwo – dimensional arraysMulti – dimensional arraysInitializationAn array can be initialized in two ways, which are as follows −Compile time initialization.Runtime initialization.Two multidimensional arraysThese are used in situations where a table of values have to be stored (or) in matrices applications.SyntaxThe syntax is given below −datatype array_ name [rowsize] [column size];For example int a[5] [5];a[0][0]10a[0][1]20a[0][2]30a[1][0]40a[1][1]50a[1][2]60a[2][0]a[2][1]a[2][2]Following is the C Program for ...

Read More

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

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

Process of Creating and Running ProgramsA program contains a set of instructions which was written in a programming language.The programmer’s job is to write and test the program.The 4 steps to convert a ‘C’ program into machine language are &miuns;Writing and editing the programCompiling the programLinking the programExecuting the programWriting and editing the program‘Text editors’ are used to write programs.With the help of text editors, users can enter, change and store character data.All special text editors are often included with a compiler.After writing the program, the file is saved to disk.It is known as ‘source file’.This file is input to ...

Read More

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

Bhanu Priya
Bhanu Priya
Updated on 11-Mar-2026 572 Views

Implicit type conversion is done by the compiler by converting smaller data type into a larger data type.For example, ASCII value of A=65.In this program, we are giving character ‘A’ as input, now write a code to convert A to 65 which is its ASCII value.ExampleFollowing is the example to find ASCII value of uppercase character ‘A’ using implicit conversion −#include int main(){    char character = 'A';    int number = 0, value;    value = character + number; //implicit conversion    printf("The ASCII value of A is: %d", value);    return 0; }OutputThe ASCII value of ‘A’ is ...

Read More

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

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

ProblemTry to print a name 10 times without using any loop or goto statement in C programming language.SolutionGenerally, looping statements are used to repeat the block of code until condition is false.Example1In this program, we are trying to print a name 10 times without using loop or goto statements.#include void printname(char* name,int count){    printf("%03d : %s",count+1,name);    count+=1;    if(count

Read More
Showing 71–80 of 1,060 articles
« Prev 1 6 7 8 9 10 106 Next »
Advertisements