Flow Control | Programming and Data Structures - Computer Science Engineering (CSE) PDF Download

Flow Control statements in C

Control statements are heart of any programming language. In your programming life you will find 60-70% of your program consist control statements. To master the art of programming, you must have a good control over your program. You must have a solid grip over control statements.
Every program by default execute sequentially. Each and every statement is executed one after other. However, there happen situations when you need to execute statement/s based on conditions. Such as display confidential files only if user has authentic credentials.
You may come across situation when you need to execute set of statements repeatedly. Such as send offer email to all clients.
Control statements in programming handles such situations. Control statement is divided in three categories.
Flow Control | Programming and Data Structures - Computer Science Engineering (CSE)

Decision statement

Decision statement is condition based statement. It define single or set of conditions that must be satisfied before statement/s can execute. For example, allow amount withdrawal from ATM, only if pin validation succeeds. These situations are handled using decision statements.
Decision statements are also known as conditional or branching statement. In decision statement we will learn about -

  • Simple if statement
  • if...else and if...else...if statement
  • Nested if...else statement
  • Switch...case

Looping statement

Looping statement defines a set of repetitive statements . These statements are repeated, with same or different parameters for a number of times.
In programming, there exists situations when you need to repeat single or a group of statements till some condition is met. Such as - read all files of a directory.
Looping statements are also known as iterative or repetitive statement.
There are three types of looping statement in C.

  • for loop
  • while loop
  • do...while loop

Jump statements

Unlike conditional and looping statement, jump statement provides unconditional way to transfer control from one part of program to other.
C supports three jump statements.

  • break
  • continue
  • goto
The document Flow Control | Programming and Data Structures - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Programming and Data Structures.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
119 docs|30 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Flow Control - Programming and Data Structures - Computer Science Engineering (CSE)

1. What is flow control in computer networking?
Ans. Flow control in computer networking refers to the mechanism used to manage the rate of data transmission between two devices. It ensures that the sender does not overwhelm the receiver with data by implementing techniques such as buffering, congestion control, and acknowledgement mechanisms.
2. How does flow control prevent data loss and congestion?
Ans. Flow control prevents data loss and congestion by regulating the rate at which data is transmitted. It ensures that the receiver is ready to receive data before the sender continues transmitting. By using techniques like buffering and acknowledgement, flow control helps in avoiding data loss and congestion by maintaining a balanced flow of data between devices.
3. What are the different types of flow control mechanisms?
Ans. There are several types of flow control mechanisms used in computer networking, including: - Stop-and-Wait: The sender waits for an acknowledgement from the receiver after sending each data packet. - Sliding Window: Allows the sender to send multiple packets without waiting for individual acknowledgements. - Selective Repeat: The sender retransmits only the lost or corrupted packets, based on selective acknowledgements from the receiver. - Automatic Repeat Request (ARQ): Implements error detection and retransmission of lost or corrupted packets.
4. What is the purpose of flow control in TCP/IP protocols?
Ans. In TCP/IP protocols, flow control ensures reliable and efficient data transfer over the network. It prevents data loss and congestion, regulates the rate of data transmission, and adapts to network conditions to optimize performance. Flow control mechanisms like window-based sliding and congestion control algorithms are essential for maintaining a stable and efficient communication between devices.
5. How does flow control impact network performance?
Ans. Flow control plays a crucial role in maintaining network performance. It prevents data loss, reduces congestion, and ensures a smooth flow of data between devices. By regulating the rate of data transmission, flow control helps in optimizing network resources, minimizing packet loss, and improving overall network efficiency.
119 docs|30 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Sample Paper

,

video lectures

,

practice quizzes

,

pdf

,

study material

,

shortcuts and tricks

,

ppt

,

Flow Control | Programming and Data Structures - Computer Science Engineering (CSE)

,

Previous Year Questions with Solutions

,

Objective type Questions

,

past year papers

,

mock tests for examination

,

Exam

,

Viva Questions

,

Semester Notes

,

Flow Control | Programming and Data Structures - Computer Science Engineering (CSE)

,

Extra Questions

,

Flow Control | Programming and Data Structures - Computer Science Engineering (CSE)

,

Important questions

,

Free

,

MCQs

,

Summary

;