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
Samenvatting

Summary C part 2

Beoordeling
-
Verkocht
-
Pagina's
17
Geüpload op
28-10-2024
Geschreven in
2024/2025

This document includes information related to c language.

Instelling
Vak

Voorbeeld van de inhoud

V.V.P Engineering College Computer Programming & Utilization

Chapter No: 3 Structure of C
Control Structure in C



CHAPTER NO: 3 Control Structure in C

Mentioned
1 Explain simple if statement with example.
2 Explain if-else statement with example.
topics in
3 Explain nested if with example.
4 Explain ladder if-else with example.
the 5 Explain switch statement with suitable example.
document6 Explain goto statement.
7 Explain while loop with example.
8 Difference between entry control and exit control (while and do-while).
9 Explain do while loop with example.
10 Explain for loop with example.
11 What is nested loop?
12 Explain break and continue statement with example.


Q-1 Explain simple If Statement with example.
Answer:
When we have situation to check some conditions ans based on that condition some statements
will be executed then we can use if statement.


Syntax:

If(<Condition>)
{
True
False //Statement block;

}
Next Statement;




Chapter no: 3

, V.V.P Engineering College Computer Programming & Utilization

Here, first condition is checked. If condition becomes true then statement inside if block will be
executed.
If condition becomes false then statement outside if block will be executed.
We can also put more than one condition to check through if statement.




True Condition False


Statement Block Next Statement



If statement is executed in following order:

1) First condition is checked.
2) If condition is true then statement block is executed first and then next statement
will be executed
3) If condition is false then next statement outside if block will be executed.
Example:
#include<stdio.h>
#include<conio.h>
Note:
void main()
Every statement in C {
ends with semicolon int var;
(;) but if statement printf(“\n enter the value of the variable”);
does not end with scanf(“%d”,&var);
semicolon. if(var<=100)
When we want to
printf(“\n the value entered is less than 100”);
execute multiple
printf(“program is over”);
statements, then {} is
}
compulsory,
otherwise not
compulsory.




Q-2. Explain if else statement with example.
Answer:



Chapter no: 3

, V.V.P Engineering College Computer Programming & Utilization

When we have situation to execute some statement if condition becomes true and other
statement if condition becomes false then we can use if else statement.




Syntax:

If(<Condition>)
True {
//Statement block1;
} False
else
{
//Statement block2;
}




Here first condition is checked first, if it becomes true then statement block1 will be executed and
if condition becomes false then statement block2 will be executed.




True False
Condition


Statement Block 1 Statement Block2


If else statement is executed in following order:

1) First condition is checked.
2) If condition is true then statement block1 is executed.
3) If condition is false then statement block2 inside else block will be executed.




Chapter no: 3

Geschreven voor

Instelling
Middelbare school
School jaar
1

Documentinformatie

Geüpload op
28 oktober 2024
Aantal pagina's
17
Geschreven in
2024/2025
Type
SAMENVATTING

Onderwerpen

$8.49
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
Yourhelper11

Maak kennis met de verkoper

Seller avatar
Yourhelper11 Private university
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
5
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