Sie sind auf Seite 1von 2

LOOPS

Where u want repetitions


1. For loop:
i=index
C,C++ syntax of for loop
For ( i=1; i<=jahan tak app chalana chahte ho; i++)
(repetitions)
{
Body of your program
}
MATLAB for loop syntax
For i=1:jahan tak apko chalan hai
Body of your sorce code
End
disp( a)
2. while loop (jab apko kuch conditions check kerni ho)
while(condition)
{
Body of your program
}
MAtlAB sysntax
While(condition)
Body of your program
End
Mean to say when the condition is true only then the while will work or
ager ek bar baher aa gyi then you will not able to enter again
[1 2 3 4 5 6 7 8 9 10]
1 3 6 10 15

55

3. there are 3 types condition statemen


1.
2.
3.
4.
5.

if
if else
if-elseif
switch
break

researchaid247@gmail.com

A=10
B=20
A=a+b

a=30

B=a-b

b=30-20=10

A=a-b

a=30-10=20

Das könnte Ihnen auch gefallen