Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Intro to Programming & Flowcharts

Beoordeling
-
Verkocht
-
Pagina's
2
Geüpload op
24-02-2023
Geschreven in
2022/2023

In this lecture, we will understand the Basics of Programming, we will create a lot of Flowcharts, also try some PseudoCodes.

Instelling
Vak

Voorbeeld van de inhoud

Lecture 3: If-Else, While loop & Lots of Patterns (Part-1)
In this 3rd lecture, we will learn the syntax of conditional statements in
CPP. We will make a simple program , where we will ask computer to print
A if A is bigger than B , else print B. Coding Ninjas has supported us in
providing this free DSA course. If you are given a number A , and you are
told that print +ve if A is positive, otherwise, print not +ve. If a block is not
executed, then 'else ' block will be executed. If A is 5 , then 'if A is -2 and if a
is -5, then it will print anything. If I enter -5 , then it did n't print anything
because if block was not executed this time. But if I add a 'else' block here,
then this block is executed. Cin. get ( ) takes input in the form of characters.
It took ' 1 ' as a character but we are assigning this value to an integer so
that 's why it printed ASCII value of that character. Cin do n't read SPACE ,
TAB , ENTER and TAB. But we have an another method to take input. Let 's
code that tells us which number is greater.



If ( a > 0) { print +ve } else { if ( a < 0 ) { print negative } , otherwise print 0 } }
Let 's run it again. Entered A as 15 It printed A is positive This time I
entered -1. A is negative. Correct output. We solved it using loop using loop
to understand loops clearly. You just have to enter a condition and the
statements which you want to execute. You can check your answer by
applying this formula Bhaiya. Here is your homework question. Q1- Find
sum of all even numbers from 1 to N. We have to tell whether n is prime or
not prime number is a number which has only 1 and N as it 's factor We will
use this % operator for this question. % tells us remainder when we divide 2
numbers. If any of these numbers gave modules as 0, then N is not prime. If
no such number exists, then it is a prime number.



We will run a loop from 1 to n , ( for all rows ) We declared a variable i to
keep the track of the row number and then we are simply printing star in

1

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
24 februari 2023
Aantal pagina's
2
Geschreven in
2022/2023
Type
College aantekeningen
Docent(en)
J
Bevat
1

Onderwerpen

€31,89
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
sameerchauhan

Maak kennis met de verkoper

Seller avatar
sameerchauhan galgotia
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
3 jaar
Aantal volgers
0
Documenten
4
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen