Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
Lecture 3: If-Else, While loop & Lots of Patterns (Part1)
In this 3rd lecture, we will learn the syntax of conditional statements in CPP
...
Coding Ninjas has supported us in providing this free DSA course
...
If a block is not executed, then 'else ' block will be
executed
...
If I enter
-5 , then it did n't print anything because if block was not executed this time
...
Cin
...
It took ' 1 ' as a character but we are assigning this value t o an
integer so that 's why it printed ASCII value of that character
...
But we have an another method to take input
...
If ( a > 0) { print +ve } else { if ( a < 0 ) { print negative } , otherwise print 0 } } Let 's
run it again
...
A is
negative
...
We solved it using loop using loop to understand loops
clearly
...
You can check your answer by applying this formula Bhaiya
...
Q1- Find sum of all even numbers from 1 to N
...
% tells us remainder when we
divide 2 numbers
...
If no such number exists, then it is a prime number
...
We will do many patterns problems in the next video
...
But first let 's understand this
code
...
J will also run from 1- N and we simply have to print the row number
...