What do you mean by odd loops in C language?

Bhanu Priya
Updated on 20-Jun-2024 22:03:02

2K+ Views

In C programming language, the Control statements are used to repeat a set of statements.They are as follows −for loopwhile loopdo-while loopIn for loop and while loop, the condition specifies the number of times, in which a loop can be executed.Example for the for loopfor (k = 1; k

Explain Lifetime of a variable in C language.

Bhanu Priya
Updated on 20-Jun-2024 21:57:34

5K+ 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 us the following factors −Where the variable is stored (in memory or cpu register)?What will be the initial value of variable, if nothing is initialized?What is the scope of variable (where it can be accessed)?What is the life of a variable?LifetimeThe lifetime of a variable defines the duration for which ... Read More

Explain Binding of a variable in C language.

Bhanu Priya
Updated on 20-Jun-2024 21:52:52

982 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 us the following factors −Where the variable is stored (in memory or cpu register)?What will be the initial value of variable, if nothing is initialized?What is the scope of variable (where it can be accessed)?What is the life of a variable?BindingBinding finds the corresponding binding occurrence (declaration/definition) for an applied ... Read More

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

Bhanu Priya
Updated on 20-Jun-2024 21:50:26

2K+ Views

We know that functions can be called by value and called by reference.If the actual parameter should not change in called function, pass the parameter-by value.If the value of actual parameter should get changed in called function, then use pass-by reference.If the function has to return more than one value, return these values indirectly by using call-by-reference. Read Also: Function Call by Value in C and Function Call by Reference in C ExampleFollowing is the C program for the demonstration of returning the multiple values − Live Demo#include void main() {    void areaperi(int, int*, int*);    int r;    float ... Read More

What are the inserting elements in queue in C language?

Bhanu Priya
Updated on 20-Jun-2024 21:43:55

3K+ Views

Data structure is collection of data organized in a structured way. It is divided into two types as explained below − Linear data structure − Data is organized in a linear fashion. For example, arrays, structures, stacks, queues, linked lists. Nonlinear data structure − Data is organized in a hierarchical way. For example, Trees, graphs, sets, tables. Read Also: Data Structures and Types Queue Queue is a linear data structure, where the insertion is done at rear end ... Read More

Explain deleting an element in a queue by using C language

Bhanu Priya
Updated on 20-Jun-2024 21:39:11

5K+ Views

Data structure is collection of data organized in a structured way. It is divided into two types as explained below −Linear data structure − Data is organized in a linear fashion. For example, arrays, structures, stacks, queues, linked lists.Nonlinear data structure − Data is organized in a hierarchical way. For example, Trees, graphs, sets, tables. Also Read: Data Structures and Types Queue Queue is a linear data structure, where the insertion is done at rear end and the deletion is done at the front end.The order of queue is FIFO – First In First OutOperationsInsert – Inserting an element into ... Read More

Find 2'c complements for given binary number using C language

Bhanu Priya
Updated on 20-Jun-2024 21:30:15

144 Views

Problem Statement Given a binary number, you have to write a C program to find 2'c complements for given binary number. Consider an example given below −ExampleThe input is as follows:Enter a binary number:10010001The output is as follows:1's complement of 10010001 is 011011102's complement of 10010001 is 01101111AlgorithmRefer an algorithm to find 2’c complements for a given binary number.Step 1 − Start.Step 2 − Read the binary number at runtime.Step 3 − Copy the binary number to strdp.Step 4 − len: = strlen(str)Step 5 − For i = 0 to len-1 do     Step 5.1 − if str[i] == ‘1’ ... Read More

What are reading and writing characters in C language?

Bhanu Priya
Updated on 20-Jun-2024 21:24:47

4K+ Views

In C programming language the reading and writing characters are as follows −The simplest of the console I/O functions are getche (), which reads a character from the keyboard, and putchar(), which prints a character to the screen.The getche () function works on until a key is pressed and then, returns its value. The key pressed is also echoed to the screen automatically.The putchar () function will write its character argument to the screen at the current cursor position.The declarations for getche () and putchar () are −int getche (void); int putchar (int c);The header file for getche () and ... Read More

Explain the functions of a Physical Layer

Ginni
Updated on 20-Jun-2024 17:05:11

4K+ Views

The physical layer meets all these requirements out. The set of rules and procedures for interaction between physical layers are called Physical layer protocols. The layer provides a physical connection different from the physical transmission path because it is at the bit level while the transmission path is at the electrical signal level. This physical connection can be a point to point physical connection or point to the multi-point physical connection, as shown in the figure − The physical layer provides its services to the data link layer, the next higher layer of the OSI model. The ... Read More

How to Convert Timestamp to Date in Java?

Mr. Satyabrata
Updated on 20-Jun-2024 15:42:32

8K+ Views

In Java, Timestamp can be converted Date by using Date class. Date class is present in java.util package. The constructor of the Date class receives a long value as an argument. Since the constructor of the Date class requires a long value, we need to convert the Timestamp object into a long value using the getTime() method of the TimeStamp class. Let's deep dive into this article, to know how it can be done by using Java programming language. To show you with instance Suppose the timestamp is 06/01/2023. Then corresponding Date is “Fri Jan ... Read More

Advertisements