In this problem, we are given a 2-dimensional matrix. Our task is to print the zigzag form of the matrix.Let’s take an example to understand the problemInput: 12 99 43 10 82 50 15 75 5 Output: 12 99 43 50 82 10 15 75 5To solve this problem, we will print the elements of the array in both directions (LtoR and RtoL). And change the direction using the flag variable.Example Live Demo#include using namespace std; void printZigZagPattern(int row, int col, int a[][5]) { int evenRow = 0; int oddRow = 1; while (evenRow
In this problem, we are a 2d matrix and a point P(c, r). Our task is to print all elements of the matrix in a spiral form (anti-clockwise) that starts from a given point P.Let’s take an example to understand our problem, Input: matrix[][] = {{3, 5, 7} } Output:To solve this problem, we use 4 loops for printing elements. Each loop prints elements of its own direction. We will start our printing from point p and go on printing the spiral form.ExampleProgram to show the implementation of our solution Live Demo#include using namespace std; const int MAX = 100; ... Read More
Use input type=”datetype”. The datetime input type is used in HTML using the . Using this, allow the users to select date and time. A date time picker popup is visible whenever input field is clicked. HTML input datetime Details: Student Name Exam Date and Time
In this problem, we are given a 2D array. Our task is to print all the elements of the array starting from the first row, from left to right, then right to left in the next row and again from left to right and so on.Let’s take an example to understand the problem.Input: array = { {2, 5} {4, 9} } Output: 2 5 9 4To solve this problem, we will print elements in the given direction (LtoR and RtoL) of a row. And a flag element to show the direction of printing will switch after every iteration.This ... Read More
In this problem, we are given a matrix. Our task is to print the matrix in reverse waveform in a single line.This example will make the problem clear, Input: 1 4 6 11 2 5 8 54 7 9 3 43 1 7 4 34 Output: 11 54 43 34 4 3 8 6 4 5 9 7 1 7 2 1To solve this problem, we have to print the reverse waveform of our matrix and for this, we will print the elements of the last column in the downward direction and then second-last column’s elements ... Read More
In this problem, we are given two numbers K and D. Our task is to print a number of k digits and which has digital root equal to D.Digital Root is a single-digit value which is the result of the recursive addition of the digits of the number till the one a single-digit number is reached. Also known as a digital sum.Let’s take an example to understand the problem, Input: D = 5 , K = 6 Output: 60000To solve this problem, we will be using trials of zero’s after the number D. Our number will be {D000..(k-1 times)}. This ... Read More
In this problem, we are given a number n. Our task is to print the largest number less than n such that all its digits are distinct.Let’s take an example to understand the problemInput: n = 2332 Output: 2319To solve this problem, we reverse the count of the numbers i.e. from n to 0. And check for number with distinct digits, if the current count values satisfy the condition print it and end the loop. Otherwise continue to loop. The max number of times the loop will run is always less than n.ExampleProgram to implement our solutions, Live Demo#include ... Read More
The frameset attribute deprecated in HTML, but you can still use it. The top-level parent doc now usesExampleXHTML and the frame uses HTML5.
The elements and are useful for screenreaders as well and help visually impaired users in reading the content of your web page. These are beneficial for eBook readers as well.Let us see how to work with both the elements. HTML Section Tag Java Inheritance Inheritance defines the relationship between superclass and subclass. Learning Learn to gain experience and try to share your knowledge with others. Web Development Tutorials Consist of CSS, HTML, and PHP tutorials for 2nd Semester exams. Academic Tutorials Consist of Computer Fundamental, Computer Network tutorials for 1st Semester exams.
Loop control statements change execution from its normal sequence. When execution leaves a scope, all automatic objects that were created in that scope are destroyed.Python supports the following control statements. Click the following links to check their detail.Let us go through the loop control statements brieflySr.NoOperator & Description1break statementTerminates the loop statement and transfers execution to the statement immediately following the loop.2continue statementCauses the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.3pass statementThe pass statement in Python is used when a statement is required syntactically but you do not want any command ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP