Bhanu Priya has Published 1581 Articles

Explain the scope rules related to the statement blocks in C language

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:21:54

102 Views

The scope rules are related to the following factors −Accessibility of a variables.Period of existence of a variable.Boundary of usage of variables.Scope rules related to statement blocks are given below −Block is enclosed in curly braces which consists of set of statements.Variables declared in a block are accessible and usable ... Read More

What is a multi-dimensional array in C language?

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:13:17

502 Views

An array is a group of related items that store with a common name.SyntaxThe syntax for declaring an array is as follows −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 ... Read More

What is a two-dimensional array in C language?

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:11:52

3K+ 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 ... Read More

What is a one-dimensional array in C language?

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:06:17

11K+ 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 arraysOne – dimensional arrayThe ... Read More

Write a C program to reverse array

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:04:15

3K+ 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];InitializationAn array can also be initialized at the time of declaration −int a[5] = { 10, 20, 30, 40, 50};Reversing array in CWe can reverse array ... Read More

C program to find Highest Common Factor (HCF) and Least Common Multiple (LCM)

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:02:48

3K+ Views

First, let us learn how to find Highest Common Factor (HCF).Highest Common Factor (HCF)The greatest number divides each of the two or more numbers is called HCF or Highest Common Factor. It is also called as Greatest Common Measure(GCM) and Greatest Common Divisor(GCD).For example, What is the HCF of 12 ... Read More

What are the predefined functions in C language?

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 15:01:55

8K+ Views

Functions are broadly classified into two types, which are as follows −Predefined functionsUser defined functionsPredefined (or) library functionsThese functions are already defined in the system libraries.Programmer will reuse the already present code in the system libraries to write error free code.But to use the library functions, user must be aware ... Read More

Explain nested switch case in C language

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 14:59:55

766 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 ... Read More

Explain switch statement in C language

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 14:58:34

6K+ Views

It is used to select one among multiple decisions. ‘switch’ successively tests a value against a list of integers (or) character constant. When a match is found, the statement (or) statements associated with that value are executed.SyntaxThe syntax is given below −switch (expression){    case value1 : stmt1;     ... Read More

Explain the concept of logical and assignment operator in C language

Bhanu Priya

Bhanu Priya

Updated on 15-Mar-2021 10:28:46

356 Views

First, let us learn about the logical operator.Logical operatorThese are used to combine 2 (or) more expressions logically.They are logical AND (&&) logical OR ( || ) and logical NOT (!)Logical AND (&&)exp1exp2exp1&&exp2TTTTFFFTFFFFLogical OR(||)exp1exp2exp1||exp2TTTTFTFTTFFFLogical NOT(!)exp!expTTFTOperatorDescriptionExamplea=10, b=20, c=30Output&&logical AND(a>b)&&(a20)&&(10b)||(a20)||(10b)!(10>20)1ExampleFollowing is the C program to compute logical operators − Live Demo#include main (){ ... Read More

Advertisements