Ask questions which are clear, concise and easy to understand.
Ask QuestionPosted by Sameera Banu 6 years, 9 months ago
- 1 answers
Posted by Visha Lini 6 years, 9 months ago
- 0 answers
Posted by Panda Pavi 6 years, 9 months ago
- 0 answers
Posted by Versha Rani 6 years, 9 months ago
- 0 answers
Posted by Tanisha Sahu 6 years, 10 months ago
- 0 answers
Posted by Yug Dixit 6 years, 10 months ago
- 0 answers
Posted by Tadrth Choudhary 6 years, 10 months ago
- 0 answers
Posted by Seethal Sharma 6 years, 10 months ago
- 0 answers
Posted by Sibi J Koola Koola 6 years, 10 months ago
- 0 answers
Posted by Sayuj Kr 6 years, 10 months ago
- 0 answers
Posted by Akshat Singh 6 years, 10 months ago
- 0 answers
Posted by Harshita Gupta 6 years, 10 months ago
- 0 answers
Posted by Pushpendra Singh 6 years, 10 months ago
- 0 answers
Posted by Ankita Shah 3 years, 5 months ago
- 1 answers
Sia ? 3 years, 5 months ago
Global variables are declared outside all the function blocks. | Local Variables are declared within a function block. |
The scope remains throughout the program. | The scope is limited and remains within the function only in which they are declared. |
Any change in global variable affects the whole program, wherever it is being used. | Any change in the local variable does not affect other functions of the program. |
A global variable exists in the program for the entire time the program is executed. | A local variable is created when the function is executed, and once the execution is finished, the variable is destroyed. |
It can be accessed throughout the program by all the functions present in the program. | It can only be accessed by the function statements in which it is declared and not by the other functions. |
If the global variable is not initialized, it takes zero by default. | If the local variable is not initialized, it takes the garbage value by default. |
Global variables are stored in the data segment of memory. | Local variables are stored in a stack in memory. |
We cannot declare many variables with the same name. | We can declare various variables with the same name but in other functions. |
Posted by Harsh Ahir 6 years, 10 months ago
- 0 answers
Posted by Ritik Deswal 6 years, 10 months ago
- 0 answers
Posted by Vinod Maliwar 6 years, 10 months ago
- 0 answers
Posted by Ruchika Khekare 6 years, 10 months ago
- 0 answers
Posted by Apurba Pal 6 years, 10 months ago
- 0 answers
Posted by Nafees Fathima 6 years, 10 months ago
- 0 answers
Posted by Kavya Singhania 6 years, 10 months ago
- 0 answers
Posted by Muskan Kumari 6 years, 10 months ago
- 0 answers
Posted by Ayush Bhatija 6 years, 10 months ago
- 0 answers
Posted by Kritika Jaswal 6 years, 10 months ago
- 0 answers
Posted by Nikita Prajapati 6 years, 10 months ago
- 0 answers
Posted by Arvind Kumar 6 years, 10 months ago
- 0 answers
Posted by Keshav Shri 6 years, 10 months ago
- 0 answers
Posted by Keshav Shri 6 years, 10 months ago
- 0 answers
Posted by Rahul Chandrasen 3 years, 5 months ago
- 1 answers
Sia ? 3 years, 5 months ago
BASIS FOR COMPARISON | WHILE | DO-WHILE |
General Form | while ( condition) { statements; //body of loop } |
do{ . statements; // body of loop. . } while( Condition ); |
Controlling Condition | In 'while' loop the controlling condition appears at the start of the loop. | In 'do-while' loop the controlling condition appears at the end of the loop. |
Iterations | The iterations do not occur if, the condition at the first iteration, appears false. | The iteration occurs at least once even if the condition is false at the first iteration. |
Alternate name | Entry-controlled loop | Exit-controlled loop |
Semi-colon | Not used | Used at the end of the loop |
Posted by Ramesh Krishnan 6 years, 10 months ago
- 0 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app
Anupma Kumari 6 years, 9 months ago
0Thank You