Author: admin
-
Loops
Loops are a programming construct that denote a block of one or more statements that are repeatedly executed a specified number of times, or till a certain condition is reached. Repetitive tasks are common in programming, and loops are essential to save time and minimize errors. In C programming, the keywords while, do–while and for are provided to implement loops. Looping constructs…
-
Nested Switch Statements
It is possible to have a switch as a part of the statement sequence of an outer switch. Even if the case constants of the inner and outer switch contain common values, no conflicts will arise. Syntax The syntax for a nested switch statement is as follows − Example Take a look at the following example − Output When the above code…
-
The Switch Statement
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case. C switch-case Statement The switch-case statement is a decision-making statement in C. The if-else statement provides two alternative actions to be performed, whereas the switch-case construct is a multi-way branching statement. A switch statement…
-
Node.js First Example
There can be console-based and web-based node.js applications. Node.js console-based Example File: console_example1.js Open Node.js command prompt and run the following code: Here, console.log() function displays message on console.Backward Skip 10sPlay VideoForward Skip 10s Node.js web-based Example A node.js web application contains the following three parts: How to create node.js web applications Follow these steps:…
-
Nested If Statements
It is always legal in C programming to nest if-else statements, which means you can use one if or else-if statement inside another if or else-if statement(s). In the programming context, the term “nesting” refers to enclosing a particular programming element inside another similar element. For example, nested loops, nested structures, nested conditional statements, etc. If an if statement in C is employed inside another if statement, then we call it as…
-
The if-else Statement
The if-else statement is one of the frequently used decision-making statements in C. The if-else statement offers an alternative path when the condition isn’t met. The else keyword helps you to provide an alternative course of action to be taken when the Boolean expression in the if statement turns out to be false. The use of else keyword is optional; it’s up to you whether you want…
-
Install Node.js on Linux/Ubuntu/CentOS
We can easily install Node.js on linux/ubuntu/centOS/fedora/linuxmint etc. To install Node.js on Linux (Ubuntu) operating system, follow these instructions: 1) Open Ubuntu Terminal (You can use shortcut keys (Ctrl+Alt+T). 2) Type command sudo apt-get install python-software-properties 3) Press Enter (If you have set a password for your system then it will ask for the password) 4)…
-
Install Node.js on Windows
To install and setup an environment for Node.js, you need the following two softwares available on your computer: Text Editor: The text editor is used to type your program. For example: Notepad is used in Windows, vim or vi can be used on Windows as well as Linux or UNIX. The name and version of…
-
The If Statement
Conditional execution of instructions is the basic requirement of a computer program. The if statement in C is the primary conditional statement. C allows an optional else keyword to specify the statements to be executed if the if condition is false. C – if Statement The if statement is a fundamental decision control statement in C programming. One or more statements in a block will…
-
Node.js Tutorial
Node.js tutorial provides basic and advanced concepts of Node.js. Our Node.js tutorial is designed for beginners and professionals both. Node.js is a cross-platform environment and library for running JavaScript applications which is used to create networking and server-side applications. Our Node.js tutorial includes all topics of Node.js such as Node.js installation on windows and linux,…