“Loop in C – Properties, and Applications”. We will cover Introduction, Details, Advantages, History, Types of Loops, Flowcharts, Practical Use, Outputs, and Conclusion. What is a loop? We are all familiar with the idea of listening to songs on loops. But, we are obviously not here to speak on that.
What is a loop in C? Looping Statements in C execute the sequence of statements many times until the stated condition becomes false. It has mainly 2 parts – a body of a loop and a control statement. The main purpose is to repeat the same code a number of times.
Loops repeat a block of code until a certain condition is met. The three types of loops in C++ are:
1. For loops use an initialization statement, test expression, and update statement to control the loop.
2. While loops continuously execute the code block as long as the test expression is true.
3. Do-while loops always execute the code block at least once before checking the test expression, and continue looping as long as the test is true.
The document discusses different types of loops in C programming: for loops, while loops, and do-while loops. For loops allow initialization of a variable, specify a condition, and how to increment the variable. While loops repeatedly execute code as long as a condition is true. Do-while loops are similar but check the condition at the bottom of the loop, so the code executes at least once. Examples of each loop type are provided.
The document discusses the for loop in C programming. It explains that the for loop iterates statements multiple times and allows initialization and increment/decrement of a variable during condition checking. The syntax of a for loop includes initialization, condition checking, and increment/decrement. Nested for loops run inner loops as many times as the limit of the outer loop condition, with the inner representing columns and outer representing rows.
The document discusses the different types of loops in C language: while loop, do-while loop, and for loop. It provides the syntax and an example of each loop. The while loop checks the condition first and repeats the block of code as long as the condition is true. The do-while loop ensures the block of code executes at least once before checking the condition. The for loop allows initialization of a counter, specifies a condition to test, and how to change the counter between iterations of the loop.
Identifiers are names given to variables, functions, and other user-defined items in a program to uniquely identify them. Identifiers must be different from keywords and other identifiers. They can include letters, digits, and underscores but must begin with a letter or underscore. Common examples of identifiers are variable and function names like roll_no and average. Identifiers are case-sensitive and allow programmers to reference specific program elements like variables during execution.
statement in python conditional statement.For more presentation please contact us on raginijain0208@gmail.com.
You get new presentation every Sunday at 10 AM.
Learn more about Python by click on this given below link
Python Introduction- https://www.slideshare.net/RaginiJain21/final-presentation-on-python
Basic concept of Python -https://www.slideshare.net/RaginiJain21/python-second-ppt
Python Datatypes - https://www.slideshare.net/RaginiJain21/data-types-in-python-248466302
Python Library & Module - https://www.slideshare.net/RaginiJain21/python-libraries-and-modules
Basic Python Programs- https://www.slideshare.net/RaginiJain21/basic-python-programs
Python Media Libarary - https://www.slideshare.net/RaginiJain21/python-media-library
The document discusses different types of nested loops in programming. It explains nested while loops, do-while loops, and nested for loops. For nested while loops, the inner loop must start after the outer loop and end before the outer loop. An example prints a series using nested while loops. Do-while loops execute the loop statement once before checking the condition. An example uses do-while to check if a number is positive or negative. Nested for loops can contain another for loop in its body, as long as the inner loop variable has a different name. An example prints a series using nested for loops.
It gives you the basic difference between among different types of loop...So here its my Presentation that help to clear all the confusions you faced while studying the LOOPS.
Loops repeat a block of code until a certain condition is met. The three types of loops in C++ are:
1. For loops use an initialization statement, test expression, and update statement to control the loop.
2. While loops continuously execute the code block as long as the test expression is true.
3. Do-while loops always execute the code block at least once before checking the test expression, and continue looping as long as the test is true.
The document discusses different types of loops in C programming: for loops, while loops, and do-while loops. For loops allow initialization of a variable, specify a condition, and how to increment the variable. While loops repeatedly execute code as long as a condition is true. Do-while loops are similar but check the condition at the bottom of the loop, so the code executes at least once. Examples of each loop type are provided.
The document discusses the for loop in C programming. It explains that the for loop iterates statements multiple times and allows initialization and increment/decrement of a variable during condition checking. The syntax of a for loop includes initialization, condition checking, and increment/decrement. Nested for loops run inner loops as many times as the limit of the outer loop condition, with the inner representing columns and outer representing rows.
The document discusses the different types of loops in C language: while loop, do-while loop, and for loop. It provides the syntax and an example of each loop. The while loop checks the condition first and repeats the block of code as long as the condition is true. The do-while loop ensures the block of code executes at least once before checking the condition. The for loop allows initialization of a counter, specifies a condition to test, and how to change the counter between iterations of the loop.
Identifiers are names given to variables, functions, and other user-defined items in a program to uniquely identify them. Identifiers must be different from keywords and other identifiers. They can include letters, digits, and underscores but must begin with a letter or underscore. Common examples of identifiers are variable and function names like roll_no and average. Identifiers are case-sensitive and allow programmers to reference specific program elements like variables during execution.
statement in python conditional statement.For more presentation please contact us on raginijain0208@gmail.com.
You get new presentation every Sunday at 10 AM.
Learn more about Python by click on this given below link
Python Introduction- https://www.slideshare.net/RaginiJain21/final-presentation-on-python
Basic concept of Python -https://www.slideshare.net/RaginiJain21/python-second-ppt
Python Datatypes - https://www.slideshare.net/RaginiJain21/data-types-in-python-248466302
Python Library & Module - https://www.slideshare.net/RaginiJain21/python-libraries-and-modules
Basic Python Programs- https://www.slideshare.net/RaginiJain21/basic-python-programs
Python Media Libarary - https://www.slideshare.net/RaginiJain21/python-media-library
The document discusses different types of nested loops in programming. It explains nested while loops, do-while loops, and nested for loops. For nested while loops, the inner loop must start after the outer loop and end before the outer loop. An example prints a series using nested while loops. Do-while loops execute the loop statement once before checking the condition. An example uses do-while to check if a number is positive or negative. Nested for loops can contain another for loop in its body, as long as the inner loop variable has a different name. An example prints a series using nested for loops.
It gives you the basic difference between among different types of loop...So here its my Presentation that help to clear all the confusions you faced while studying the LOOPS.
Importance of loops in any programming language is immense, they allow us to reduce the number of lines in a code, making our code more readable and efficient.
This document discusses nested loops, which are loop statements inside other looping statements. It provides examples of nested for loops, while loops, and do-while loops. The nested for loop runs the inner loop as many times as the limit of the outer loop condition. The nested while loop executes the inner code block as long as the inner condition is true, and the outer block as long as the outer condition is true. The nested do-while similarly runs the inner block first and checks the inner condition, and the outer block first and checks the outer condition. Examples are given to print a diamond pattern using nested loops.
loops play a vital role in any programming language, they allow the programmer to write more readable and effective code. The looping concept also allows us to reduce the number of lines.
1) A friend function allows access to private and protected members of a class. It is declared inside the class using the keyword "friend".
2) A friend function is not a member function - it is defined outside of the class and does not have access to non-static members using the class object. However, it can access private and protected members of the class.
3) In the example, the Temperature class declares the temp function as a friend. This allows temp to directly access and modify the private celsius member, something that regular non-member functions cannot do. The friend declaration gives temp special access privileges.
C programs are composed of six types of tokens: keywords, identifiers, constants, strings, special symbols, and operators. Keywords are reserved words that serve as building blocks for statements and cannot be used as names. Identifiers name variables, functions, and arrays and must begin with a letter. Constants represent fixed values and come in numeric, character, and string forms. Special symbols include braces, parentheses, and brackets that indicate code blocks, function calls, and arrays. Operators perform arithmetic, assignment, comparison, logic, and other operations.
This document introduces pseudocode, which is a non-programming language used to design the logic and flow of a program before writing the actual code. It discusses common pseudocode structures like input/output, conditional statements, loops, and cases. Examples are given for how operations would be written in pseudocode versus actual programming languages like C# and Pascal. The document provides an assignment to write pseudocode that gets a number from the user and prints a message depending on if the number is less than or greater than 7.
This document discusses different types of loops in C programming. It describes while, for, do-while, and nested loops. While loops execute a block of code as long as a condition is true. For loops allow executing a block of code a specific number of times. Do-while loops are similar to while loops but execute the block at least once even if the condition is false. Nested loops allow a loop to be placed inside another loop to repeat a block of code multiple times.
This document discusses user-defined functions in C programming. It explains that user-defined functions must be developed by the programmer, unlike library functions. It covers the need for user-defined functions to organize code into logical, reusable units. The key elements of functions - definition, call, and declaration - are described. Functions can return values and take parameters to perform tasks. Well-defined functions make code more modular, readable, and maintainable.
The break and continue statements can be used to control the flow of loops in C programming.
- The break statement causes immediate exit from a loop. Program execution continues after the loop. It is commonly used to escape early from a loop or skip the remainder of a switch structure.
- The continue statement skips the remaining statements in the body of a loop for that iteration and proceeds with the next iteration. In a while or do-while loop, the continuation test is evaluated immediately after continue. In a for loop, the increment expression is executed before the continuation test.
- An example shows using continue in a for loop to skip printing the value 5 and proceed to the next iteration of the loop.
The conditional operator, also known as the ternary operator, allows an expression to take on one of two values based on whether a condition is true or false. It requires three operands - a condition, a value if the condition is true, and a value if the condition is false. The conditional operator provides a shorthand for a basic if-else statement where a variable is assigned one of two values based on a condition. While it can be nested, doing so reduces readability, so conditional operators are best used only in place of simple if-else assignments rather than complex nested logic.
String in programming language in c or c++ Samsil Arefin
This document discusses strings in C programming. It defines strings as arrays of characters terminated by a null character. Strings can be declared as character arrays or using string pointers. Functions like strlen(), strcpy(), strcat() are described which operate on strings. Examples are given to find the frequency of characters, number of vowels/consonants, reversing a string, sorting strings, and concatenating strings. The strcat() function is explained in detail, with an example program demonstrating how it concatenates two strings.
This document provides information about loop statements in programming. It discusses the different parts of a loop, types of loops including while, for, and do-while loops. It also covers nested loops and jump statements like break and continue. Examples are given for each loop type. The document concludes with multiple choice and program-based questions as exercises.
Loop(for, while, do while) condition PresentationBadrul Alam
This document discusses three types of loops in Java programming: for loops, while loops, and do-while loops. It provides the syntax, flow diagrams, and examples of each loop type. Additionally, it covers the break and continue statements that can be used within loops to alter their flow control, with examples of how each statement works.
The document discusses C functions, including their definition, types, uses, and implementation. It notes that C functions allow large programs to be broken down into smaller, reusable blocks of code. There are two types of functions - library functions and user-defined functions. Functions are declared with a return type, name, and parameters. They are defined with a body of code between curly braces. Functions can be called within a program and allow code to be executed modularly and reused. Parameters can be passed by value or by reference. Functions can return values or not, and may or may not accept parameters. Overall, functions are a fundamental building block of C that improve code organization, reusability, and maintenance.
The document discusses files in C programming and file input/output operations. It defines what a file is and explains the need for files when storing and accessing data. There are two main types of files - text files and binary files. The key file I/O functions in C like fopen(), fclose(), fprintf(), fscanf(), fgets(), fputs() and their usage are explained. Both formatted and unformatted I/O functions are covered along with reading and writing characters, integers and strings to files.
The document discusses different types of language translators including compilers, interpreters, and assemblers. A language translator converts source code into object code that computers can understand. Compilers convert an entire program into object code at once, while interpreters convert code line-by-line. Compilers are generally faster but require more memory, and errors are detected after compilation. Interpreters are slower but use less memory and can detect errors as they interpret each line.
C is a general-purpose programming language developed in the 1970s. It combines high-level language features with low-level language efficiency and flexibility. C programs are portable, meaning they can run on many different computer systems. C laid the foundation for many other popular languages by providing core functionality like functions, arrays, structures, and pointers in a simple syntax that is efficient for systems programming tasks.
A compiler converts source code into object code, while a linker links programs to necessary libraries. The process of developing a C program involves opening an IDE, editing code, saving the file, compiling for errors, executing if no errors, and repeating the edit-compile cycle until the program runs successfully and outputs results. More information can be found at the provided blog link.
This document discusses different types of loops in computer programming including for, while, and do-while loops. It provides definitions and descriptions of each loop type, their syntax, and how they work. Nested loops are also covered, which are loops used inside other loops. Key details covered include how for loops iterate with a loop variable, while loops test conditions before executing, and do-while loops check conditions at the bottom of the loop so they always execute at least once.
Importance of loops in any programming language is immense, they allow us to reduce the number of lines in a code, making our code more readable and efficient.
This document discusses nested loops, which are loop statements inside other looping statements. It provides examples of nested for loops, while loops, and do-while loops. The nested for loop runs the inner loop as many times as the limit of the outer loop condition. The nested while loop executes the inner code block as long as the inner condition is true, and the outer block as long as the outer condition is true. The nested do-while similarly runs the inner block first and checks the inner condition, and the outer block first and checks the outer condition. Examples are given to print a diamond pattern using nested loops.
loops play a vital role in any programming language, they allow the programmer to write more readable and effective code. The looping concept also allows us to reduce the number of lines.
1) A friend function allows access to private and protected members of a class. It is declared inside the class using the keyword "friend".
2) A friend function is not a member function - it is defined outside of the class and does not have access to non-static members using the class object. However, it can access private and protected members of the class.
3) In the example, the Temperature class declares the temp function as a friend. This allows temp to directly access and modify the private celsius member, something that regular non-member functions cannot do. The friend declaration gives temp special access privileges.
C programs are composed of six types of tokens: keywords, identifiers, constants, strings, special symbols, and operators. Keywords are reserved words that serve as building blocks for statements and cannot be used as names. Identifiers name variables, functions, and arrays and must begin with a letter. Constants represent fixed values and come in numeric, character, and string forms. Special symbols include braces, parentheses, and brackets that indicate code blocks, function calls, and arrays. Operators perform arithmetic, assignment, comparison, logic, and other operations.
This document introduces pseudocode, which is a non-programming language used to design the logic and flow of a program before writing the actual code. It discusses common pseudocode structures like input/output, conditional statements, loops, and cases. Examples are given for how operations would be written in pseudocode versus actual programming languages like C# and Pascal. The document provides an assignment to write pseudocode that gets a number from the user and prints a message depending on if the number is less than or greater than 7.
This document discusses different types of loops in C programming. It describes while, for, do-while, and nested loops. While loops execute a block of code as long as a condition is true. For loops allow executing a block of code a specific number of times. Do-while loops are similar to while loops but execute the block at least once even if the condition is false. Nested loops allow a loop to be placed inside another loop to repeat a block of code multiple times.
This document discusses user-defined functions in C programming. It explains that user-defined functions must be developed by the programmer, unlike library functions. It covers the need for user-defined functions to organize code into logical, reusable units. The key elements of functions - definition, call, and declaration - are described. Functions can return values and take parameters to perform tasks. Well-defined functions make code more modular, readable, and maintainable.
The break and continue statements can be used to control the flow of loops in C programming.
- The break statement causes immediate exit from a loop. Program execution continues after the loop. It is commonly used to escape early from a loop or skip the remainder of a switch structure.
- The continue statement skips the remaining statements in the body of a loop for that iteration and proceeds with the next iteration. In a while or do-while loop, the continuation test is evaluated immediately after continue. In a for loop, the increment expression is executed before the continuation test.
- An example shows using continue in a for loop to skip printing the value 5 and proceed to the next iteration of the loop.
The conditional operator, also known as the ternary operator, allows an expression to take on one of two values based on whether a condition is true or false. It requires three operands - a condition, a value if the condition is true, and a value if the condition is false. The conditional operator provides a shorthand for a basic if-else statement where a variable is assigned one of two values based on a condition. While it can be nested, doing so reduces readability, so conditional operators are best used only in place of simple if-else assignments rather than complex nested logic.
String in programming language in c or c++ Samsil Arefin
This document discusses strings in C programming. It defines strings as arrays of characters terminated by a null character. Strings can be declared as character arrays or using string pointers. Functions like strlen(), strcpy(), strcat() are described which operate on strings. Examples are given to find the frequency of characters, number of vowels/consonants, reversing a string, sorting strings, and concatenating strings. The strcat() function is explained in detail, with an example program demonstrating how it concatenates two strings.
This document provides information about loop statements in programming. It discusses the different parts of a loop, types of loops including while, for, and do-while loops. It also covers nested loops and jump statements like break and continue. Examples are given for each loop type. The document concludes with multiple choice and program-based questions as exercises.
Loop(for, while, do while) condition PresentationBadrul Alam
This document discusses three types of loops in Java programming: for loops, while loops, and do-while loops. It provides the syntax, flow diagrams, and examples of each loop type. Additionally, it covers the break and continue statements that can be used within loops to alter their flow control, with examples of how each statement works.
The document discusses C functions, including their definition, types, uses, and implementation. It notes that C functions allow large programs to be broken down into smaller, reusable blocks of code. There are two types of functions - library functions and user-defined functions. Functions are declared with a return type, name, and parameters. They are defined with a body of code between curly braces. Functions can be called within a program and allow code to be executed modularly and reused. Parameters can be passed by value or by reference. Functions can return values or not, and may or may not accept parameters. Overall, functions are a fundamental building block of C that improve code organization, reusability, and maintenance.
The document discusses files in C programming and file input/output operations. It defines what a file is and explains the need for files when storing and accessing data. There are two main types of files - text files and binary files. The key file I/O functions in C like fopen(), fclose(), fprintf(), fscanf(), fgets(), fputs() and their usage are explained. Both formatted and unformatted I/O functions are covered along with reading and writing characters, integers and strings to files.
The document discusses different types of language translators including compilers, interpreters, and assemblers. A language translator converts source code into object code that computers can understand. Compilers convert an entire program into object code at once, while interpreters convert code line-by-line. Compilers are generally faster but require more memory, and errors are detected after compilation. Interpreters are slower but use less memory and can detect errors as they interpret each line.
C is a general-purpose programming language developed in the 1970s. It combines high-level language features with low-level language efficiency and flexibility. C programs are portable, meaning they can run on many different computer systems. C laid the foundation for many other popular languages by providing core functionality like functions, arrays, structures, and pointers in a simple syntax that is efficient for systems programming tasks.
A compiler converts source code into object code, while a linker links programs to necessary libraries. The process of developing a C program involves opening an IDE, editing code, saving the file, compiling for errors, executing if no errors, and repeating the edit-compile cycle until the program runs successfully and outputs results. More information can be found at the provided blog link.
This document discusses different types of loops in computer programming including for, while, and do-while loops. It provides definitions and descriptions of each loop type, their syntax, and how they work. Nested loops are also covered, which are loops used inside other loops. Key details covered include how for loops iterate with a loop variable, while loops test conditions before executing, and do-while loops check conditions at the bottom of the loop so they always execute at least once.
This document discusses loops in C++ programming. It defines while, for, and do-while loops and how each one works. It also describes loop control statements like break, continue, and goto that change the normal execution of loops. Finally, it provides an example of an infinite loop in C++ using a for loop without a conditional expression to repeat indefinitely.
Loops allow blocks of code to be repeatedly executed. The three types of loops in C are while loops, for loops, and do-while loops. While loops check the condition before each iteration. For loops allow initialization, condition checking, and increment/decrement in the loop header. Do-while loops check the condition after executing the block at least once. Break and continue statements can be used to exit or skip portions of loops. Switch statements compare a value to multiple case values and execute the corresponding block.
Visual Basic loop structures allow you to run one or more lines of code repetitively. You can repeat the statements in a loop structure until a condition is True, until a condition is False, a specified number of times, or once for each element in a collection.
C++ provides several types of loops to repeat blocks of code, including while, for, do-while, and nested loops. Loop control statements like break, continue, and goto change the normal execution flow. An infinite loop is one whose condition never becomes false, allowing the loop to repeat indefinitely until terminated.
This presentation educates you about R-loops with the following general form of a loop statement in most of the programming languages, Loop Type & Description, Loop Control Statements, Control Statement & Description.
For more topics stay tuned with Learnbay.
This document discusses different types of loops in Java programming: while, for, do-while, and enhanced for loops. It provides the syntax and flow for each loop type along with examples. The key loop types are:
- While loops repeat while a condition is true, testing at the start of each iteration.
- For loops iterate a specific number of times, with initialization, condition, and update sections.
- Do-while loops are like while loops but test the condition at the end, so the body executes at least once.
- Enhanced for loops iterate over collections/arrays, declaring a block variable to access each element.
The document discusses various loop constructs in C language including while loops, do-while loops, and for loops. It explains the syntax and usage of each loop type and compares while and do-while loops. The document also covers logical operators, formatted input/output functions, controlling loop execution, and one-dimensional arrays in C.
This document discusses control statements and decision making in C programming. It describes the different types of conditional statements like if, if-else, if-else-ladder statements. It also covers loops like while, for, do-while loops and their syntax. Finally, it discusses single line and multi-line comments in C with examples.
Loops IN COMPUTER SCIENCE STANDARD 11 BY KRKrishna Raj
This document provides an overview of different types of loop statements in computer programming, including while loops, for loops, do-while loops, and nested loops. It also discusses jump statements like break, continue, goto, and exit that change the normal flow of loops. The key types of loops covered are while loops, which repeat a statement as long as a condition is true, for loops, which allow initialization of loop variables, testing a condition, and updating variables each iteration, and do-while loops, which first execute the statement and then check the condition.
The document discusses looping in C programming. It defines looping as repeating a block of code until a condition is met. There are three types of loops in C: while loops, do-while loops, and for loops. The key components of a loop are a counter, initialization of the counter, a condition to check the counter against, the statements to execute, and an increment/decrement. Examples of each loop type are provided.
#loops, #c, #program, #loops in c, #c loops, #loops introduction, #while and do while loop, #for loop in c programming, #loops in c programming, #c programming loop, #c loop programs, #looping structure in c, #looping
The document discusses various control structures and functions used in Arduino programming including decision making structures like if, else if, else statements and switch case statements. It also covers different types of loops like while, do-while and for loops that allow repeating blocks of code. Functions are described as reusable blocks of code that perform tasks and help organize a program. Strings can be implemented as character arrays or using the String class, and various string functions are provided to manipulate and work with strings.
This document discusses different types of loop constructs in C programming language. It describes while, do-while and for loops. While and do-while loops execute statements repeatedly as long as a given condition is true. For loops allow initialization of counters, check a condition, and update the counter each iteration. The document also covers flow charts to illustrate loop execution and examples of each loop type as well as continue, break and goto statements that change loop flow.
This document discusses for loops in Java. It covers the basic syntax of a for loop including the initialization, test, and update expressions. It provides an example of using a for loop to print a text 5 times. It also discusses variations of for loops including infinite loops, multiple loop control variables, missing initialization/test/update expressions, and loops with empty bodies. Finally, it covers the enhanced for loop (for-each loop) syntax and provides an example of using it to print array elements.
Learn C# Programming - Decision Making & LoopsEng Teong Cheah
The document provides an overview of decision making structures and loops in C#. It discusses if, if-else, if-else if-else statements, switch statements, and how to nest conditional logic. It also covers while, for, do-while loops, nested loops, and loop control statements like break and continue. Examples are provided for each structure to demonstrate their syntax and usage.
The document discusses do-while loops and switch statements in C++. It provides explanations of the syntax and flow of do-while loops, including that the code block is executed at least once before the condition is checked. It also explains switch statements, including that they provide an alternative to nested if-else statements when there are multiple choices and only one should be executed. Examples are provided of using do-while loops to display numbers and switch statements to perform arithmetic operations based on an operator.
Similar to Loop in C Properties & Applications (20)
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
Physiology and chemistry of skin and pigmentation, hairs, scalp, lips and nail, Cleansing cream, Lotions, Face powders, Face packs, Lipsticks, Bath products, soaps and baby product,
Preparation and standardization of the following : Tonic, Bleaches, Dentifrices and Mouth washes & Tooth Pastes, Cosmetics for Nails.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Assessment and Planning in Educational technology.pptxKavitha Krishnan
In an education system, it is understood that assessment is only for the students, but on the other hand, the Assessment of teachers is also an important aspect of the education system that ensures teachers are providing high-quality instruction to students. The assessment process can be used to provide feedback and support for professional development, to inform decisions about teacher retention or promotion, or to evaluate teacher effectiveness for accountability purposes.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
3. Electrical Engineering Department
What is a Loop ?
Looping Statements in C execute the sequence
of statements many times until the stated
condition becomes false. A loop in C consists of
two parts, a body of a loop and a control
statement. The control statement is a
combination of some conditions that direct the
body of the loop to execute until the specified
condition becomes false. The purpose of the C
loop is to repeat the same code a number of
times.
4. Electrical Engineering Department
LOOP is nothing but a language that precisely captures primitive recursive
functions. The only operations supported in the language are assignment,
addition, and looping a number of times that is fixed before loop execution
starts.
The LOOP language was introduced in 1967 by Albert R. Meyer and Dennis M.
Ritchie. Meyer and Ritchie showed the correspondence between the LOOP
language and primitive recursive functions. Dennis M. Ritchie mainly
formulated the LOOP language.
It is known that the FOR loop has been part of the C language since the early
1970s (or late 1960s) and was developed by John Backus, but the DO loop
has been a part of Fortran since it was developed in the mid-1950s by John
Backus and his team at IBM.
The name for-loop comes from the word for, which is used as the keyword in
many programming languages to introduce a for-loop. The term in English
dates to ALGOL 58 and was popularized in the influential later ALGOL 60.
The loop body is executed "for" the given values of the loop variable, though
this is more explicit in the ALGOL version of the statement, in which a list of
possible values and/or increments can be specified.
(There’s no relevant name or origin related history for while & do while loop)
History of LOOPs
5. Electrical Engineering Department
Advantages of LOOPs
● It provides code reusability.
● Using loops, we do not need to write the same code
again and again.
● Using loops, we can traverse over the elements of
data structures (array or linked lists).
8. Electrical Engineering Department
In programming, LOOPs are considered as controlled
statements that can regulate the flow of the program
execution. They use a conditional expression in order to
decide to what extent a particular block should be
repeated. Every loop consists of two sections, loop body
and control statement.
Based on the position of these two sections, loop
execution can be handled in two ways that are at the
entry-level and exit-level.
So, loops can be categorized into two types:
● Entry controlled loop: When a condition is evaluated
at the beginning of the loop.
● Exit controlled loop: When a condition is evaluated at
the end of the loop.
9. Electrical Engineering Department
Entry Controlled Loop: An entry control loop checks
condition at entry level (at beginning), that’s why it is
termed as entry control loop. It is a type of loop in which
the condition is checked first and then after the loop
body executed. For loop and while loop fall in this
category. If the condition is true, the loop body would be
executed otherwise, the loop would be terminated.
Exit Control Loop: An exit control loop checks condition
at exit level (in the end), that’s why it is termed as exit
control loop. Oppose to Entry controlled loop, it is a loop
in which condition is checked after the execution of the
loop body. Do while loop is the example. The loop body
would be executed at least once, no matter if the test
condition is true or false.
10. Electrical Engineering Department
FOR LOOP
● A For loop is the most efficient loop structure in C
programming. It allows us to write a loop that needs
to execute a specific number of times. The for loop in
C language is used to iterate the statements or a part
of the program several times. It is frequently used to
traverse the data structures like the array and linked
list.
● Syntax of for loop in C
The syntax of for loop in c language is given below:
for( initialization; condition; increment/decrement)
{
//code to be executed
}
11. Electrical Engineering Department
How for loop works?
● The initialization statement is executed only once.
● Then, the test expression is evaluated. If the test
expression is evaluated to false, the for loop is
terminated.
● However, if the test expression is evaluated to true,
statements inside the body of the for loop are
executed, and the update expression is updated.
● Again the test expression is evaluated.
*This process goes on until the test expression is false.
When the test expression is false, the loop terminates.
13. Electrical Engineering Department
A While Loop is used to repeat a specific block of code an
unknown number of times, until a condition is met. For
example, if we want to ask a user for a number between 1
and 10, we don't know how many times the user may enter
a larger number, so we keep asking "while the number is
not between 1 and 10". If we (or the computer) knows
exactly how many times to execute a section of code
(such as shuffling a deck of cards) we use a for loop.
The syntax of while loop in c language is given below:
while (condition){
//code to be executed
}
Flowchart and Example of while loop
While LOOP
14. Electrical Engineering Department
Why While Loops?
● Like all loops, "while loops" execute
blocks of code over and over again.
● The advantage to a while loop is that
it will go (repeat) as often as
necessary to accomplish its goal.
15. Electrical Engineering Department
How while Loop works?
In while loop, condition is evaluated first
and if it returns true then the statements
inside while loop execute, this happens
repeatedly until the condition returns
false. When condition returns false, the
control comes out of loop and jumps to the
next statement in the program after while
loop.
17. Electrical Engineering Department
The do...while statement creates a loop that executes a specified
statement until the test condition evaluates to false. The condition is
evaluated after executing the statement, resulting in the specified
statement executing at least once.
The syntax for do…while loop is stated below:
do
{
//code to be executed
}while(condition);
● Unlike for and while loops, that test the loop condition at the top of
the loop, the do...while loop checks its condition at the bottom of
the loop.
● A do...while loop is similar to a while loop, except that a do...while
loop is guaranteed to execute at least one time, where only while
loop executes the target statement, repeatedly.
Do while LOOP
18. Electrical Engineering Department
How Do...While loop works
The conditional expression appears at the end of the
loop, so the statement(s) in the loop executes once
before the condition is tested.
If the condition is true, the flow of control jumps back
up to do, and the statement(s) in the loop executes
again. This process repeats until the given condition
becomes false.
20. Electrical Engineering Department
DIFFERENCE BETWEEN WHILE LOOP AND DO WHILE LOOP
● Condition is checked first then
statement(s) is executed.
● It might occur statement(s) is
executed zero times, If condition
is false..
● No semicolon at the end of
while.
while(condition)
● If there is a single statement,
brackets are not required.
● Variable in condition is initialized
before the execution of loop.
● while loop is entry controlled
loop.
● while (condition)
{ statement(s); }
● Statement(s) is executed at
least once, thereafter condition
is checked.
● At least once the statement(s) is
executed.
● Semicolon at the end of while.
while(condition);
● Brackets are always required.
● variable may be initialized
before or within the loop.
● do-while loop is exit controlled
loop.
● do { statement(s); }
while(condition);
While loop Do-while loop
21. Electrical Engineering Department
NESTed LOOP
A nested loop has one loop inside of another. These are typically
used for working with two dimensions such as printing stars in
rows and columns the syntax are shown below. When a loop is
nested inside another loop, the inner loop runs many times inside
the outer loop. In each iteration of the outer loop, the inner loop
will be re-started. The inner loop must finish all of its iterations
before the outer loop can continue to its next iteration.
Syntax of Nested loop
OuterLoop
{
InnerLoop
{
// inner loop statements.
}
// outer loop statements.
}
23. Electrical Engineering Department
Infinitive
loop
To make a for loop infinite,
we need not give any
expression in the syntax.
Instead of that, we can put
two semicolons to validate
the syntax of the for loop. It
will work as an infinite for
loop.
For example :
#include <stdio.h>
void main()
{ int i = 10;
for( ; ;)
{
printf("%dn",i);
}
}
In while loop, when the
condition passes and if it is
true , it runs infinite number
of times.
For example :
#include <stdio.h>
void main()
{ int i = 10;
while(1)
{
printf("%dt",i);
i++;
}
}
The do-while loop will run
infinite times if we pass any
non-zero value as the
conditional expression.
For example :
#include <stdio.h>
void main()
{ int i = 10;
do
{
printf("%dt",i);
i++;
} while(i);
}
24. Electrical Engineering Department
BREAK AND CONTINUE STATEMENTS
● When a break statement is
encountered inside a loop, the loop
is immediately terminated and the
program control resumes at the next
statement following the loop.
For the for loop, continue statement
causes the conditional test and increment
portions of the loop to execute. For the
while and do...while loops, continue
statement causes the program control to
pass to the conditional tests.
true
25. Electrical Engineering Department
Practical Use
Real World Examples of Loop
● Software of the ATM machine is in a loop to process
transaction after transaction until you acknowledge that
you have no more to do.
● Software program in a mobile device allows user to unlock
the mobile with 5 password attempts. After that it resets
mobile device.
● You put your favorite song on a repeat mode. It is also a
loop.
● You want to run a particular analysis on each column of
your data set.
28. Electrical Engineering Department
CONCLUSION
Looping in C or in any programming language is one of
the key concepts. There are generally two types that are
entry controlled and exit controlled loop. The loops or
statement blocks execute a number of times until the
condition becomes false.
❖ Advantages
● Using loops, we do not need to write the same code
again and again.
● Using loops, we can traverse over the elements of
data structures (array or linked lists).
● It provides code reusability.