🎓 Academic Baka naman..

Status
Not open for further replies.

wendski

Fanatic
Baka meron pa kau idea na wala sa idea ko..Pandagdag lang mga idol hahaha
 

Attachments

  • IMG_20220125_141324.webp
    IMG_20220125_141324.webp
    18.4 KB · Views: 21
1.For loop allows a programmer to execute a sequence of statements several times, it abbreviates the code which helps to manage loop variables.While , While loop allows a programmer to repeat a single statement or a group of statements for the TRUE condition. It verifies the condition before executing the loop.A "For" Loop is used to repeat a specific block of code a known number of times. For example, if we want to check the grade of every student in the class, we loop from 1 to that number. When the number of times is not known before hand, we use a "While" loop.



In general, you should use a for loop when you know how many times the loop should run. If you want the loop to break based on a condition other than the number of times it runs, you should use a while loop.

Strings and arrays are quite similar except the length of an array is fixed whereas strings can have a variable number of elements. Technically, arrays are a special type of variable that can hold more than one value at a time. They are a sequential collection of elements of similar data types, whereas strings are a sequence of characters used to represent text rather than numbers. In addition, strings are immutable which means the value of an object cannot be modified once it’s created, while arrays are mutable meaning the fields can be modified. Simply put, an array is a collection of like-type variables whereas a string is a sequence of characters represented by a single data type.
 
1.For loop allows a programmer to execute a sequence of statements several times, it abbreviates the code which helps to manage loop variables.While , While loop allows a programmer to repeat a single statement or a group of statements for the TRUE condition. It verifies the condition before executing the loop.A "For" Loop is used to repeat a specific block of code a known number of times. For example, if we want to check the grade of every student in the class, we loop from 1 to that number. When the number of times is not known before hand, we use a "While" loop.



In general, you should use a for loop when you know how many times the loop should run. If you want the loop to break based on a condition other than the number of times it runs, you should use a while loop.

Strings and arrays are quite similar except the length of an array is fixed whereas strings can have a variable number of elements. Technically, arrays are a special type of variable that can hold more than one value at a time. They are a sequential collection of elements of similar data types, whereas strings are a sequence of characters used to represent text rather than numbers. In addition, strings are immutable which means the value of an object cannot be modified once it’s created, while arrays are mutable meaning the fields can be modified. Simply put, an array is a collection of like-type variables whereas a string is a sequence of characters represented by a single data type.
Salamat prof sa pag share ng idea mo rin.
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 321
    Views
  • 2
    Participants
Last reply from:
Professora Akira

Online now

Members online
1,010
Guests online
1,145
Total visitors
2,155

Forum statistics

Threads
2,276,157
Posts
28,967,932
Members
1,231,140
Latest member
KarlKARL
Back
Top