A control structure refers to the way in which the Programmer specifies the order of executing the statements

Size: px
Start display at page:

Download "A control structure refers to the way in which the Programmer specifies the order of executing the statements"

Transcription

1

2 Control Structures A control structure refers to the way in which the Programmer specifies the order of executing the statements The following approaches can be chosen depending on the problem statement: Sequential In a sequential approach, all the statements are executed in the same order as it is written Selectional In a selectional approach, based on some conditions, different set of statements are executed Iterational (Repetition) In an iterational approach certain statements are executed repeat

3 Selectional Control Structures There are two select ional control structures If statement Switch statement

4 Simple if Statement In a simple if statement, a condition is tested If the condition is true, a set of statements are executed If the condition is false, the statements are not executed and the program control goes to the next statement that immediately follows if block Syntax: if (condition) Statement(s); Next Statement; condition False Next Statement True Set of Statement(s) if (iduration >= 3) /* Interest for deposits equal to or more than 3 years is 6.0% */ frateofinterest = 6.0;

5 else Statement (1 of 2) In simple if statement, when the condition is true, a set of statements are executed. But when it is false, there is no alternate set of statements The statement else provides the same Syntax: if (condition) Statement set-1; else Statement set-2; Next Statement; condition False Statement set-2 Next Statement True Statement set-1

6 else Statement (2 of 2) Example: if (iduration >= 3) /* If duration is equal to or more than 3 years, Interest rate is 6.0 */ frateofinterest = 6.0; else /* else, Interest rate is 5.5 */ frateofinterest = 5.5;

7 else if Statement (1 of 2) The else if statement is to check for a sequence of conditions When one condition is false, it checks for the next condition and so on When all the conditions are false the else block is executed The statements in that conditional block are executed and the other if statements are skipped Syntax: if (condition-1) Statement set-1; else if (condition-2) Statement set-2; else if (condition-n) Statement set-n; else Statement set-x;

8 else if Statement (2 of 2) Always use else if when a sequence of conditions has to be tested. Using only if will make the compiler to check all the conditions. This increases the execution time Amateur code (Using only if ) if (iduration >= 6) frateofinterest = 6.5; if ((iduration >= 3) && (iduration < 6)) frateofinterest = 6.0; if (iduration == 2) frateofinterest = 5.5; if (iduration == 1) frateofinterest = 5.0; Professional code (Using else if ) if (iduration >= 6) frateofinterest = 6.5; else if ((iduration >= 3) && (iduration < 6)) frateofinterest = 6.0; else if (iduration == 2) frateofinterest = 5.5; else frateofinterest = 5.0;

9 Example (1 of 2 ) #include<stdio.h> #include<conio.h> main() int result; printf("enter your mark:"); scanf("%d",&result); if (result >=55) printf("passed\n"); printf("congratulations\n"); else printf("failed\n"); printf("good luck repeating this subject :D \n"); getch(); return 0; a) 77 b) 55 c) 48 d) 21

10 Example (2 of 2 ) #include<stdio.h> #include<conio.h> main() int test1,test2; int result; printf("enter your mark for Test 1:"); scanf("%d",&test1); printf("enter your mark for Test 2:"); scanf("%d",&test2); result=(test1+test2)/2; if(result>=80) printf("passed: Grade A\n"); else if (result>=70) printf("passed: Grade B\n"); else if (result >=55) printf("passed: Grade C\n"); else printf("failed\n"); getch(); return 0;

11 Assignment(=) vs. Equality Operator (==) (1 of 3) The operator = is used for assignment purposes whereas the operator == is used to check for equality It is a common mistake to use = instead of == to check for equality The compiler does not generate any error message Example: if (interest = 6.5) printf( Minimum Duration of deposit: 6 years ); else if (interest = 6.0) printf( Minimum Duration of deposit: 3 years ); else printf( No such interest rate is offered ); The output of the above program will be Minimum Duration of deposit: 6 years the control structure Is ignored

12 Assignment(=) vs. Equality Operator (==) (2 of 3) To overcome the problem, when constants are compared with variables for equality, write the constant on the left hand side of the equality symbol Example: if (6.5 = interest) printf( Minimum Duration of deposit: 6 years ); else if (6.0 = interest) printf( Minimum Duration of deposit: 3 years ); else printf( No such interest rate is offered ); When the above code is compiled it generates compilation errors because the variable s value is being assigned to a constant This helps in trapping the error at compile time itself, even before it goes to unit testing

13 Assignment(=) vs. Equality Operator (==) (3 of 3) Corrected Code: if (6.5 == interest) printf( Minimum Duration of deposit: 6 years ); else if (6.0 == interest) printf( Minimum Duration of deposit: 3 years ); else printf( No such interest rate is offered );

14 Nested if Statement An if statement embedded within another if statement is called as nested if Example: if (iduration > 6 ) if (dprincipalamount > 25000) printf( Your percentage of incentive is 4% ); else printf( Your percentage of incentive is 2% ); else printf( No incentive );

15 #include<stdio.h> #include<conio.h> main() What the output if int iduration, dprincipalamount; a. iduration=9 printf("enter value for iduration:"); dprincipalamount=26000 scanf("%d",&iduration); b. iduration=10 if (iduration > 6 ) dprincipalamount=21000 printf("what is yout dprincipalamount:"); c. iduration=4 scanf("%d",&dprincipalamount); dprincipalamount=21000 if (dprincipalamount > 25000) printf("your percentage of incentive is 4%"); else printf("your percentage of incentive is 2%"); else printf("no incentive"); getch(); return 0;

16 Example Nested if #include<stdio.h> #include<conio.h> main() int num1; int num2; printf("please enter two integers\n"); printf("num1:"); scanf("%d",&num1); printf("num2:"); scanf("%d",&num2); if(num1<=num2) if(num1<num2) printf("%d < %d\n", num1,num2); else printf("%d==%d\n",num1,num2); else printf("%d > %d\n",num1, num2); getch(); return 0; What the output if a. num1=55 num2=55 b. num1=25 num2=89 c. num1=90 num2=10

17 What is the output of the following code snippet? iresult = inum % 2; if ( iresult = 0) printf("the number is even"); else printf("the number is odd"); CASE 1: When inum is 11 CASE 2: When inum is 8 The output is "The number is odd" Explains??? The output is "The number is odd"

18 The switch statement is a type of decision control structure that selects a choice from the set of available choices It is very similar to if statement But switch statement cannot replace if statement in all situations Syntax: Switch(integer variable or integer expression or character variable) case integer or character constant-1 : Statement(s); case integer or character constant-2 : Statement(s); case integer or character constant-n : default: Statement(s); Statement(s);

19 What is the output of the following code snippet? int inino = 2; switch(inino) case 1: printf( ONE ); case 2: printf( TWO ); case 3: printf( THREE ); default: printf( INVALID ); Output: TWO

20 What is the output of the following code snippet? switch (departmentcode) case 110 : printf( HRD ); case 115 : printf( IVS ); case 125 : printf( E&R ); case 135 : printf( CCD ); Assume departmentcode is 115 and find the output

21 What is the output of the following code snippet? int inum = 2; switch(inum) case 1.5: printf( ONE AND HALF ); case 2: printf( TWO ); case A : printf( A character ); Case 1.5: this is invalid because the values in case statements must be integers

22 What is the output of the following code snippet? unsigned int icountofitems = 5; switch (icountofitems) case icountofitems >=10 : printf( Enough Stock ); default : printf( Not enough stock ); Error: Relational Expressions cannot be used in switch statement

23 An Example switch case #include<stdio.h> #include<conio.h> main() char ch; printf("enter the vowel:"); scanf("%c",&ch); switch(ch) case 'a' : printf("vowel"); case 'e' : printf("vowel"); case 'i' : printf("vowel"); case 'o' : printf("vowel"); case 'u' : printf ("Vowel"); default : printf("not a vowel"); getch(); return 0;

24 An Example switch case char ch= a ; switch(ch) case a : printf( Vowel ); case e : printf( Vowel ); case i : printf( Vowel ); case o : printf( Vowel ); case u : printf ( Vowel ); default : printf( Not a vowel ); char ch= a ; switch(ch) case a : case e : case i : case o : case u : printf( Vowel ); default : printf( Not a vowel );

25 An Example switch case #include<stdio.h> #include<conio.h> main() int greeting; printf("enter the number of your desired greetings :"); scanf("%d",&greeting); switch (greeting) case 1: printf("happy Hari Raya"); case 2: printf("happy Deepavali"); case 3: printf("happy New Year"); default: printf("you choose wrong choice"); getch(); return 0; If you choose a. 1 Happy Hari Raya b. 2 Happy Deepavali c. 3 Happy New Year d. Other than that. You choose wrong choice

26 Iteration Control Structures Iterational (repetitive) control structures are used to repeat certain statements for a specified number of times The statements are executed as long as the condition is true These kind of control structures are also called as loop control structures are three kinds of loop control structures: while do while for

27 do while Loop Control Structure The do while loop is very similar to while loop. In do while loop, the condition is tested at the end of the loop Because of this, even when the condition is false, the body of the loop is executed at least once This is an exit-controlled loop Syntax: do Set of statement(s); while (condition); Next Statement; Set of statements condition False Next Statement True

28 SOME CONDITIONS FOR WHILE LOOP 1.the statement within the while loop would keep on getting executed till condition being tested remains true. 2.if condition becomes falls the control passes to the first statement that follows the body of the while loop. 3. the condition being tested may use may use relational or logical operators.

29 The statement within the loop may be a single line or a block of statement. for example--while ( i <= 10 ) i = i + 1; is same as while ( i <= 10) i = i + 1 ; It is not necessary that a loop counter must be an int. it can be float also. main( ) float a=10.0; while(float a<=10.5) printf("raindrops on roses"); a=a+0.1;

30 do while Loop Control Structure Execution proceeds as follows: First the loop is executed, next the condition is evaluated, if condition evaluates to true the loop continues execution else control passes to the next statement following the loop The do-while statement can also terminate when a break, goto, or return statement is executed within the statement body. This is an example of the do-while statement: do a = b ; b = b 1; while ( b > 0 ); In the above do-while statement, the two statements a = b; and b = b - 1; are executed, regardless of the initial value of b. Then b > 0 is evaluated. If b is greater than 0, the statement body is executed again and b > 0 is reevaluated. The statement body is executed repeatedly as long as b remains greater than 0. Execution of the do-while statement terminates when b becomes 0 or ve. The body of the loop is executed at least once.

31 THE 'DO WHILE' LOOP The do-while loop looks like this: do this ; and this ; and this ; and this ; while ( this condition is true ) ; The major difference between the while loop and dowhile loop is that The while tests the condition before executing any of the statements within the while loop. As against this, the do-while tests the condition after having executed the statements within the loop.

32 do while Loop Control Structure Example int inumber, isum = 0; do printf( Enter a number. Type 0(zero) to end the input ); scanf( %d,&inumber); isum = isum + inumber; while (inumber!= 0);

33 While loop The condition is tested before entering into the loop. When the condition is false at the initial stage, the loop statements are not executed at all. It is an entry-controlled loop. do while loop The condition is tested at the end of the loop. The statements are executed at least once even when the condition is false. It is an exit-controlled loop.

34 do while and while Example #include<stdio.h> #include<conio.h> int main(void) int x=1; do printf("%d", x++); while (x<5); getch(); return 0; #include<stdio.h> #include<conio.h> int main(void) int x=1; while(x<5) printf("%d", x); x++; getch(); return 0;

35 for Loop Control Structure The for loops are similar to the other loop control structures The for loops are generally used when certain statements have to be executed a specific number of times Advantage of for loops: All the three parts of a loop (initialization, condition and increment) can be given in a single statement Because of this, there is no chance of user missing out initialization or increment steps which is the common programming error in while and do while loops Syntax: for (Initialization; Termination-Condition; Increment-Step) Set of statement(s); Next Statement;

36 Syntax: for (Initialization; Termination-Condition; Increment-Step) Set of statement(s); Next Statement; In executing a for statement, the computer does the following: Initialization is executed. Then the Termination-condition is evaluated. If it computes to zero the loop is exited. If the (1)Termination-condition gives a nonzero value, the (2)LoopBody is executed and then the (3)Increment-step is evaluated. The Termination-condition is again tested. Thus, the LoopBody is repeated until the Termination-condition computes to a zero value.

37 for Loop Control Structure Example: Initialization int icount; for (icount = 1; icount <= 10; icount++) condition True Set of statements printf( %d\n,icount); False Next Statement Increment

38 the 'for' allows us to specify three things about a loop in a single line-- a- setting a loop counter to an initial value. b- testing the loop counter to determine whether it's value has reached the number of repetition desired. c-increasing the value of loop counter each time the program segment with in the loop has been executed. the general form of 'for' statement is as follows for(initialize counter;test counter;increment counter) do this; and this; and this;

39 example- /* Calculation of simple interest for 3 sets of p, n and r */ main ( ) int p, n, count ; float r, si ; for ( count = 1 ; count <= 3 ; count = count + 1 ) printf ( "Enter values of p, n, and r " ) ; scanf ( "%d %d %f", &p, &n, &r ) ; si = p * n * r / 100 ; printf ( "Simple Interest = Rs.%f\n", si ) ; the execution process for the above program is given as follows- When the for statement is executed for the first time, the value of count is set to an initial value 1. Now the condition count <= 3 is tested. Since count is 1 the condition is satisfied and the body of the loop is executed for the first time. Upon reaching the closing brace of for, control is sent back to the for statement, where the value of count gets incremented by 1. Again the test is performed to check whether the new value of count exceeds 3. If the value of count is still within the range 1 to 3, the statements within the braces of for are executed again. The body of the for loop continues to get executed till count doesn t exceed the final value 3. When count reaches the value 4 the control exits from the loop and is transferred to the statement (if any) immediately after the body of for.

40 for Loop Control Structure /* Check for n number of students, whether they have passed or not */ #include<stdio.h> #include<conio.h> int main(void) int icounter, inoofstudents; float fmark1, fmark2, fmark3, favg, fsum; for(icounter=1; icounter<=inoofstudents; icounter++) /* Accepting the marks scored by the students in 3 subjects */ /* Display a message before accepting the marks*/ printf("enter the marks scored by the student %d in 3 subjects\n", icounter); printf("subject1:"); scanf("%f",&fmark1); printf("subject2:"); scanf("%f",&fmark2); printf("subject3:"); scanf("%f",&fmark3); /* calculating the average marks */ fsum=fmark1+fmark2+fmark3; favg=fsum/3; /* compare the average with 65 and decide whether student has passed or failed */ if ( favg >= 65.0) printf("student %d - PASSES\n", icounter); else printf("student %d - FAILS\n", icounter); getch(); return 0;

41 for Loop Control Structure #include<stdio.h> #include<conio.h> int main(void) int x, y; for(x=0,y=1;x<y;x++) printf("%d %d",x,y); getch(); return 0; O 1

42 for Loop Control Structure #include<stdio.h> #include<conio.h> int main(void) int x; for(x=1;x<5;x++) printf("%d",x); getch(); return 0;

43 What is the output of the following code snippet? int inum; int icounter; int iproduct; for(icounter=1; icounter<= 3; icounter++) iproduct = iproduct * icounter; printf("%d", iproduct); The output is a junk value -- WHY??? This is because iproduct is not initialized

44 What is the output of the following code snippet? for(icount=0;icount<10;icount++); printf("%d\n",icount); The output is 10 int icount; for(icount=0;icount<10;icount++) printf("%d\n",icount); The output is

45 for and while loops Given #include<stdio.h> #include<conio.h> int main(void) int isum,ictr,inum; for(isum=0,ictr=0; ictr<10;ictr=ictr+1) printf("enter mark: "); scanf("%d",&inum); isum=isum+inum; printf("%d",isum); getch(); return 0; Rewrite it using while statement #include<stdio.h> #include<conio.h> int main(void) int isum,ictr,inum; isum=0,ictr=0; while(ictr<10) printf("enter mark: "); scanf("%d",&inum); isum=isum+inum; ictr=ictr+1; printf("%d",isum); getch(); return 0;

46 Quitting the Loops break Statement The break statement is used to: Force the termination of a loop. When a break statement is encountered in a loop, the loop terminates immediately and the execution resumes the next statement following the loop. Note: Break statement can be used in an if statement only when the if statement is written in a loop Just an if statement with break leads to compilation error in C

47 What is the output of the following code snippet? int icounter1=0; int icounter2; while(icounter1 < 3) for (icounter2 = 0; icounter2 < 5; icounter2++) printf("%d\t",icounter2); if (icounter2 == 2) printf("\n"); icounter1 += 1;

48 Continuing the Loops - continue Statement continue statement forces the next iteration of the loop to take place and skips the code between continue statement and the end of the loop In case of for loop, continue makes the execution of the increment portion of the statement and then evaluates the conditional part. In case of while and do-while loops, continue makes the conditional statement to be executed. Example: for(icount = 0 ; icount < 10; icount++) if (icount == 4) continue; printf( %d, icount); The above code displays numbers from 1 to 9 except 4.

49 Comparison of break, continue and exit break continue exit() Used to quit an innermost loop or switch Can be used only within loops or switch Used to continue the innermost loop Can be used only within the loops Used to terminate the program Can be used anywhere in the program

50 What is the output of the following code snippet? Case 1: Case 3: icount = 1; do printf( %d\n,icount); icount++; if (icount == 5) continue; while(icount < 10); Case 2: icount = 1; while (icount < 10) if (icount == 5) continue; printf( %d\n,icount); icount++; for (icount=1;icount <= 10; icount++) if (icount % 2 == 0) continue; printf( %d\n,icount); Case 4: for (icount=1;icount <= 5; icount++) for (ivalue =1; ivalue <= 3; ivalue++) if (ivalue == 2) printf( %d\n,ivalue);

51 Selecting between while, do while and for loops A for loop is used when the number of times the loop is executed is well known A while loop is used when the number of times the loop gets executed is not known and the loop should not be executed when the condition is initially false A do while loop is used when the number of times the loop gets executed is not known and the loop should be executed even when the condition is initially false

52

UIC. C Programming Primer. Bharathidasan University

UIC. C Programming Primer. Bharathidasan University C Programming Primer UIC C Programming Primer Bharathidasan University Contents Getting Started 02 Basic Concepts. 02 Variables, Data types and Constants...03 Control Statements and Loops 05 Expressions

More information

Introduction. C provides two styles of flow control:

Introduction. C provides two styles of flow control: Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if

More information

Prepared by: Shraddha Modi

Prepared by: Shraddha Modi Prepared by: Shraddha Modi Introduction In looping, a sequence of statements are executed until some conditions for termination of the loop are satisfied. A program loop consist of two segments Body of

More information

Unit 5. Decision Making and Looping. School of Science and Technology INTRODUCTION

Unit 5. Decision Making and Looping. School of Science and Technology INTRODUCTION INTRODUCTION Decision Making and Looping Unit 5 In the previous lessons we have learned about the programming structure, decision making procedure, how to write statements, as well as different types of

More information

Chapter 5: Control Structures

Chapter 5: Control Structures Chapter 5: Control Structures In this chapter you will learn about: Sequential structure Selection structure if if else switch Repetition Structure while do while for Continue and break statements S1 2017/18

More information

DECISION CONTROL AND LOOPING STATEMENTS

DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL STATEMENTS Decision control statements are used to alter the flow of a sequence of instructions. These statements help to jump from one part of

More information

Computers Programming Course 7. Iulian Năstac

Computers Programming Course 7. Iulian Năstac Computers Programming Course 7 Iulian Năstac Recap from previous course Operators in C Programming languages typically support a set of operators, which differ in the calling of syntax and/or the argument

More information

Module 4: Decision-making and forming loops

Module 4: Decision-making and forming loops 1 Module 4: Decision-making and forming loops 1. Introduction 2. Decision making 2.1. Simple if statement 2.2. The if else Statement 2.3. Nested if Statement 3. The switch case 4. Forming loops 4.1. The

More information

Flow of Control. Selection. if statement. True and False in C False is represented by any zero value. switch

Flow of Control. Selection. if statement. True and False in C False is represented by any zero value. switch Flow of Control True and False in C Conditional Execution Iteration Nested Code(Nested-ifs, Nested-loops) Jumps 1 True and False in C False is represented by any zero value The int expression having the

More information

SELECTION STATEMENTS:

SELECTION STATEMENTS: UNIT-2 STATEMENTS A statement is a part of your program that can be executed. That is, a statement specifies an action. Statements generally contain expressions and end with a semicolon. Statements that

More information

Branching is deciding what actions to take and Looping is deciding how many times to take a certain action.

Branching is deciding what actions to take and Looping is deciding how many times to take a certain action. 3.0 Control Statements in C Statements The statements of a C program control the flow of program execution. A statement is a command given to the computer that instructs the computer to take a specific

More information

There are algorithms, however, that need to execute statements in some other kind of ordering depending on certain conditions.

There are algorithms, however, that need to execute statements in some other kind of ordering depending on certain conditions. Introduction In the programs that we have dealt with so far, all statements inside the main function were executed in sequence as they appeared, one after the other. This type of sequencing is adequate

More information

Subject: PIC Chapter 2.

Subject: PIC Chapter 2. 02 Decision making 2.1 Decision making and branching if statement (if, if-, -if ladder, nested if-) Switch case statement, break statement. (14M) 2.2 Decision making and looping while, do, do-while statements

More information

Lecture 6. Statements

Lecture 6. Statements Lecture 6 Statements 1 Statements This chapter introduces the various forms of C++ statements for composing programs You will learn about Expressions Composed instructions Decision instructions Loop instructions

More information

ECE15: Introduction to Computer Programming Using the C Language. Lecture Unit 4: Flow of Control

ECE15: Introduction to Computer Programming Using the C Language. Lecture Unit 4: Flow of Control ECE15: Introduction to Computer Programming Using the C Language Lecture Unit 4: Flow of Control Outline of this Lecture Examples of Statements in C Conditional Statements The if-else Conditional Statement

More information

Unit 3 Decision making, Looping and Arrays

Unit 3 Decision making, Looping and Arrays Unit 3 Decision making, Looping and Arrays Decision Making During programming, we have a number of situations where we may have to change the order of execution of statements based on certain conditions.

More information

Decision Making -Branching. Class Incharge: S. Sasirekha

Decision Making -Branching. Class Incharge: S. Sasirekha Decision Making -Branching Class Incharge: S. Sasirekha Branching The C language programs presented until now follows a sequential form of execution of statements. Many times it is required to alter the

More information

INTRODUCTION TO C++ PROGRAM CONTROL. Dept. of Electronic Engineering, NCHU. Original slides are from

INTRODUCTION TO C++ PROGRAM CONTROL. Dept. of Electronic Engineering, NCHU. Original slides are from INTRODUCTION TO C++ PROGRAM CONTROL Original slides are from http://sites.google.com/site/progntut/ Dept. of Electronic Engineering, NCHU Outline 2 Repetition Statement for while do.. while break and continue

More information

3 The L oop Control Structure

3 The L oop Control Structure 3 The L oop Control Structure Loops The while Loop Tips and Traps More Operators The for Loop Nesting of Loops Multiple Initialisations in the for Loop The Odd Loop The break Statement The continue Statement

More information

REPETITION CONTROL STRUCTURE LOGO

REPETITION CONTROL STRUCTURE LOGO CSC 128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING REPETITION CONTROL STRUCTURE 1 Contents 1 Introduction 2 for loop 3 while loop 4 do while loop 2 Introduction It is used when a statement or a block of

More information

Comments. Comments: /* This is a comment */

Comments. Comments: /* This is a comment */ Flow Control Comments Comments: /* This is a comment */ Use them! Comments should explain: special cases the use of functions (parameters, return values, purpose) special tricks or things that are not

More information

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University ITC213: STRUCTURED PROGRAMMING Bhaskar Shrestha National College of Computer Studies Tribhuvan University Lecture 08: Control Statements Readings: Chapter 6 Control Statements and Their Types A control

More information

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade;

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade; Control Statements Control Statements All programs could be written in terms of only one of three control structures: Sequence Structure Selection Structure Repetition Structure Sequence structure The

More information

Chapter 6. Loops. Iteration Statements. C s iteration statements are used to set up loops.

Chapter 6. Loops. Iteration Statements. C s iteration statements are used to set up loops. Chapter 6 Loops 1 Iteration Statements C s iteration statements are used to set up loops. A loop is a statement whose job is to repeatedly execute some other statement (the loop body). In C, every loop

More information

Programming for Engineers Iteration

Programming for Engineers Iteration Programming for Engineers Iteration ICEN 200 Spring 2018 Prof. Dola Saha 1 Data type conversions Grade average example,-./0 class average = 23450-67 893/0298 Grade and number of students can be integers

More information

& Technology. Expression? Statement-x. void main() int no; scanf("%d", &no); if(no%2==0) if(no%2!=0) Syllabus for 1. of execution of statements.

& Technology. Expression? Statement-x. void main() int no; scanf(%d, &no); if(no%2==0) if(no%2!=0) Syllabus for 1. of execution of statements. statement- Computer Programming and Utilization (CPU) 110003 D) Decision Control Structure (if, if, if e if, switch, ) 1 Explain if with example and draw flowchart. if is used to control the flow of execution

More information

DECISION MAKING STATEMENTS

DECISION MAKING STATEMENTS DECISION MAKING STATEMENTS If, else if, switch case These statements allow the execution of selective statements based on certain decision criteria. C language provides the following statements: if statement

More information

Programming for Electrical and Computer Engineers. Loops

Programming for Electrical and Computer Engineers. Loops Programming for Electrical and Computer Engineers Loops Dr. D. J. Jackson Lecture 6-1 Iteration Statements C s iteration statements are used to set up loops. A loop is a statement whose job is to repeatedly

More information

Statements. Control Flow Statements. Relational Operators. Logical Expressions. Relational Operators. Relational Operators 1/30/14

Statements. Control Flow Statements. Relational Operators. Logical Expressions. Relational Operators. Relational Operators 1/30/14 Statements Control Flow Statements Based on slides from K. N. King Bryn Mawr College CS246 Programming Paradigm So far, we ve used return statements and expression statements. Most of C s remaining statements

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 5 Structured Program Development Department of Computer Engineering How to develop

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 5 - Structured Program Development Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad How to develop a program? Requirements Problem Analysis

More information

MODULE 2: Branching and Looping

MODULE 2: Branching and Looping MODULE 2: Branching and Looping I. Statements in C are of following types: 1. Simple statements: Statements that ends with semicolon 2. Compound statements: are also called as block. Statements written

More information

Decision Making and Loops

Decision Making and Loops Decision Making and Loops Goals of this section Continue looking at decision structures - switch control structures -if-else-if control structures Introduce looping -while loop -do-while loop -simple for

More information

UNIT 4. CONTROL FLOW. Programming Year Grade in Industrial Technology Engineering. Paula de Toledo. David Griol

UNIT 4. CONTROL FLOW. Programming Year Grade in Industrial Technology Engineering. Paula de Toledo. David Griol Programming Unit 4. Control flow Haga clic para modificar el estilo de texto del patrón UNIT 4. CONTROL FLOW Programming Year 2017-2018 Grade in Industrial Technology Engineering Paula de Toledo. David

More information

Problem # 1. calculate the grade. Allow a student the next grade if he/she needs only 0.5 marks to obtain the next grade. Use else-if construction.

Problem # 1. calculate the grade. Allow a student the next grade if he/she needs only 0.5 marks to obtain the next grade. Use else-if construction. ME 172 Lecture 6 Problem # 1 Write a program to calculate the grade point average of a 3.00 credit hour course using the data obtained from the user. Data contains four items: attendance (30), class test

More information

C++ PROGRAMMING SKILLS Part 2 Programming Structures

C++ PROGRAMMING SKILLS Part 2 Programming Structures C++ PROGRAMMING SKILLS Part 2 Programming Structures If structure While structure Do While structure Comments, Increment & Decrement operators For statement Break & Continue statements Switch structure

More information

Chapter 2. Introduction to C language. Together Towards A Green Environment

Chapter 2. Introduction to C language. Together Towards A Green Environment Chapter 2 Introduction to C language Aim Aim of this chapter is to provide the fundamentals for basic program construction using C. Objectives To understand the basic information such as keywords, character

More information

Case Control Structure. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Case Control Structure. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan Case Control Structure DCS COMSATS Institute of Information Technology Rab Nawaz Jadoon Assistant Professor COMSATS IIT, Abbottabad Pakistan Introduction to Computer Programming (ICP) Decision control

More information

C: How to Program. Week /Mar/05

C: How to Program. Week /Mar/05 1 C: How to Program Week 2 2007/Mar/05 Chapter 2 - Introduction to C Programming 2 Outline 2.1 Introduction 2.2 A Simple C Program: Printing a Line of Text 2.3 Another Simple C Program: Adding Two Integers

More information

Week 4 Selection Structures. UniMAP Sem II-11/12 DKT121 Basic Computer Programming 1

Week 4 Selection Structures. UniMAP Sem II-11/12 DKT121 Basic Computer Programming 1 Week 4 Selection Structures UniMAP Sem II-11/12 DKT121 Basic Computer Programming 1 Outline Recall selection control structure Types of selection One-way selection Two-way selection Multi-selection Compound

More information

CS1100 Introduction to Programming

CS1100 Introduction to Programming Decisions with Variables CS1100 Introduction to Programming Selection Statements Madhu Mutyam Department of Computer Science and Engineering Indian Institute of Technology Madras Course Material SD, SB,

More information

Chapter 4: Expressions. Chapter 4. Expressions. Copyright 2008 W. W. Norton & Company. All rights reserved.

Chapter 4: Expressions. Chapter 4. Expressions. Copyright 2008 W. W. Norton & Company. All rights reserved. Chapter 4: Expressions Chapter 4 Expressions 1 Chapter 4: Expressions Operators Expressions are built from variables, constants, and operators. C has a rich collection of operators, including arithmetic

More information

Chapter 3 Structured Program Development

Chapter 3 Structured Program Development 1 Chapter 3 Structured Program Development Copyright 2007 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 3 - Structured Program Development Outline 3.1 Introduction

More information

CHAPTER 9 FLOW OF CONTROL

CHAPTER 9 FLOW OF CONTROL CHAPTER 9 FLOW OF CONTROL FLOW CONTROL In a program statement may be executed sequentially, selectively or iteratively. Every program language provides constructs to support sequence, selection or iteration.

More information

n Group of statements that are executed repeatedly while some condition remains true

n Group of statements that are executed repeatedly while some condition remains true Looping 1 Loops n Group of statements that are executed repeatedly while some condition remains true n Each execution of the group of statements is called an iteration of the loop 2 Example counter 1,

More information

C Program. Output. Hi everyone. #include <stdio.h> main () { printf ( Hi everyone\n ); }

C Program. Output. Hi everyone. #include <stdio.h> main () { printf ( Hi everyone\n ); } C Program Output #include main () { printf ( Hi everyone\n ); Hi everyone #include main () { printf ( Hi everyone\n ); #include and main are Keywords (or Reserved Words) Reserved Words

More information

Structured Program Development

Structured Program Development Structured Program Development Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan Outline Introduction The selection statement if if.else switch The

More information

Flow Control. CSC215 Lecture

Flow Control. CSC215 Lecture Flow Control CSC215 Lecture Outline Blocks and compound statements Conditional statements if - statement if-else - statement switch - statement? : opertator Nested conditional statements Repetitive statements

More information

Loops / Repetition Statements. There are three loop constructs in C. Example 2: Grade of several students. Example 1: Fixing Bad Keyboard Input

Loops / Repetition Statements. There are three loop constructs in C. Example 2: Grade of several students. Example 1: Fixing Bad Keyboard Input Loops / Repetition Statements Repetition s allow us to execute a multiple times Often they are referred to as loops C has three kinds of repetition s: the while loop the for loop the do loop The programmer

More information

PDS Lab Section 16 Autumn Tutorial 3. C Programming Constructs

PDS Lab Section 16 Autumn Tutorial 3. C Programming Constructs PDS Lab Section 16 Autumn-2017 Tutorial 3 C Programming Constructs This flowchart shows how to find the roots of a Quadratic equation Ax 2 +Bx+C = 0 Start Input A,B,C x B 2 4AC False x If 0 True B x 2A

More information

Decision Making and Branching

Decision Making and Branching INTRODUCTION Decision Making and Branching Unit 4 In the previous lessons we have learned about the programming structure, data types, declaration of variables, tokens, constants, keywords and operators

More information

COMP 208 Computers in Engineering

COMP 208 Computers in Engineering COMP 208 Computers in Engineering Lecture 14 Jun Wang School of Computer Science McGill University Fall 2007 COMP 208 - Lecture 14 1 Review: basics of C C is case sensitive 2 types of comments: /* */,

More information

Day06 A. Young W. Lim Wed. Young W. Lim Day06 A Wed 1 / 26

Day06 A. Young W. Lim Wed. Young W. Lim Day06 A Wed 1 / 26 Day06 A Young W. Lim 2017-09-20 Wed Young W. Lim Day06 A 2017-09-20 Wed 1 / 26 Outline 1 Based on 2 C Program Control Overview for, while, do... while break and continue Relational and Logical Operators

More information

Loops / Repetition Statements

Loops / Repetition Statements Loops / Repetition Statements Repetition statements allow us to execute a statement multiple times Often they are referred to as loops C has three kinds of repetition statements: the while loop the for

More information

Score score < score < score < 65 Score < 50

Score score < score < score < 65 Score < 50 What if we need to write a code segment to assign letter grades based on exam scores according to the following rules. Write this using if-only. How to use if-else correctly in this example? score Score

More information

Computers Programming Course 12. Iulian Năstac

Computers Programming Course 12. Iulian Năstac Computers Programming Course 12 Iulian Năstac Recap from previous course Strings in C The character string is one of the most widely used applications that involves vectors. A string in C is an array of

More information

Week 2. Relational Operators. Block or compound statement. if/else. Branching & Looping. Gaddis: Chapters 4 & 5. CS 5301 Spring 2018.

Week 2. Relational Operators. Block or compound statement. if/else. Branching & Looping. Gaddis: Chapters 4 & 5. CS 5301 Spring 2018. Week 2 Branching & Looping Gaddis: Chapters 4 & 5 CS 5301 Spring 2018 Jill Seaman 1 Relational Operators l relational operators (result is bool): == Equal to (do not use =)!= Not equal to > Greater than

More information

Dr. R. Z. Khan, Associate Professor, Department of Computer Science

Dr. R. Z. Khan, Associate Professor, Department of Computer Science ALIGARH MUSLIM UNIVERSITY Department of Computer Science Course: CSM-102: Programming & Problem Solving Using C Academic Session 2015-2016 UNIT-2: Handout-3 Topic: Control Structures (Selection & Repetition)

More information

CHAPTER : 9 FLOW OF CONTROL

CHAPTER : 9 FLOW OF CONTROL CHAPTER 9 FLOW OF CONTROL Statements-Statements are the instructions given to the Computer to perform any kind of action. Null Statement-A null statement is useful in those case where syntax of the language

More information

Computer Programming. Decision Making (2) Loops

Computer Programming. Decision Making (2) Loops Computer Programming Decision Making (2) Loops Topics The Conditional Execution of C Statements (review) Making a Decision (review) If Statement (review) Switch-case Repeating Statements while loop Examples

More information

Introduction to Programming

Introduction to Programming Introduction to Programming ( 數 ) Lecture 4 Spring 2005 March 11, 2005 Topics Review of if statement The switch statement Repetition and Loop Statements For-Loop Condition-Loop Reading: Chap. 5.7~ Chap.

More information

Chapter 2 - Introduction to C Programming

Chapter 2 - Introduction to C Programming Chapter 2 - Introduction to C Programming 2 Outline 2.1 Introduction 2.2 A Simple C Program: Printing a Line of Text 2.3 Another Simple C Program: Adding Two Integers 2.4 Memory Concepts 2.5 Arithmetic

More information

C++ Programming Lecture 7 Control Structure I (Repetition) Part I

C++ Programming Lecture 7 Control Structure I (Repetition) Part I C++ Programming Lecture 7 Control Structure I (Repetition) Part I By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department while Repetition Structure I Repetition structure Programmer

More information

EECE.2160: ECE Application Programming Spring 2018

EECE.2160: ECE Application Programming Spring 2018 EECE.2160: ECE Application Programming Spring 2018 1. (46 points) C input/output; operators Exam 1 Solution a. (13 points) Show the output of the short program below exactly as it will appear on the screen.

More information

Introduction to Computing Lecture 07: Repetition and Loop Statements (Part II)

Introduction to Computing Lecture 07: Repetition and Loop Statements (Part II) Introduction to Computing Lecture 07: Repetition and Loop Statements (Part II) Assist.Prof.Dr. Nükhet ÖZBEK Ege University Department of Electrical & Electronics Engineering nukhet.ozbek@ege.edu.tr Topics

More information

Fundamentals of Computer Programming Using C

Fundamentals of Computer Programming Using C CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar Faculty Name: Ami D. Trivedi Class: FYBCA Subject: US01CBCA01 (Fundamentals of Computer Programming Using C) *UNIT 3 (Structured Programming, Library Functions

More information

CP FAQS Q-1) Define flowchart and explain Various symbols of flowchart Q-2) Explain basic structure of c language Documentation section :

CP FAQS Q-1) Define flowchart and explain Various symbols of flowchart Q-2) Explain basic structure of c language Documentation section : CP FAQS Q-1) Define flowchart and explain Various symbols of flowchart ANS. Flowchart:- A diagrametic reperesentation of program is known as flowchart Symbols Q-2) Explain basic structure of c language

More information

CSE 130 Introduction to Programming in C Control Flow Revisited

CSE 130 Introduction to Programming in C Control Flow Revisited CSE 130 Introduction to Programming in C Control Flow Revisited Spring 2018 Stony Brook University Instructor: Shebuti Rayana Control Flow Program Control Ø Program begins execution at the main() function.

More information

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 2 (Minor modifications by the instructor) 1 Scope Rules A variable declared inside a function is a local variable Each local variable in a function comes into existence when the function

More information

Repetition Structures II

Repetition Structures II Lecture 9 Repetition Structures II For and do-while loops CptS 121 Summer 2016 Armen Abnousi Types of Control Structures Sequential All programs that we have written so far The statements inside a pair

More information

University of California San Diego Department of Electrical and Computer Engineering. ECE 15 Midterm Exam

University of California San Diego Department of Electrical and Computer Engineering. ECE 15 Midterm Exam University of California San Diego Department of Electrical and Computer Engineering ECE 15 Midterm Exam Tuesday, February 17, 2015 12:30 p.m. 1:50 p.m. Room 109, Pepper Canyon Hall Name Class Account:

More information

Programming - 1. Computer Science Department 011COMP-3 لغة البرمجة 1 لطالب كلية الحاسب اآللي ونظم المعلومات 011 عال- 3

Programming - 1. Computer Science Department 011COMP-3 لغة البرمجة 1 لطالب كلية الحاسب اآللي ونظم المعلومات 011 عال- 3 Programming - 1 Computer Science Department 011COMP-3 لغة البرمجة 1 011 عال- 3 لطالب كلية الحاسب اآللي ونظم المعلومات 1 1.1 Machine Language A computer programming language which has binary instructions

More information

Chapter 13 Control Structures

Chapter 13 Control Structures Chapter 13 Control Structures Control Structures Conditional making a decision about which code to execute, based on evaluated expression if if-else switch Iteration executing code multiple times, ending

More information

DELHI PUBLIC SCHOOL TAPI

DELHI PUBLIC SCHOOL TAPI Loops Chapter-1 There may be a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially: The first statement in a function is executed

More information

Lecture 10. Daily Puzzle

Lecture 10. Daily Puzzle Lecture 10 Daily Puzzle Imagine there is a ditch, 10 feet wide, which is far too wide to jump. Using only eight narrow planks, each no more than 9 feet long, construct a bridge across the ditch. Daily

More information

SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, ) SOLUTION

SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, ) SOLUTION SHARDA UNIVERSITY SCHOOL OF ENGINEERING & TECHNOLOGY Mid Term Examination, (Odd Term, 2016-17) SOLUTION Program: B. Tech. Branch: All Term:I Subject: Logic Building and Problem Solving Using C Paper Code:

More information

Decision making with if Statement : - Control Statements. Introduction: -

Decision making with if Statement : - Control Statements. Introduction: - Control Statements Introduction: - Any C program if you consider, the set of statements are normally executed sequentially in the order in which they are written, and such programs have sequential structure

More information

Chapter 3: Arrays and More C Functionality

Chapter 3: Arrays and More C Functionality Chapter 3: Arrays and More C Functionality Objectives: (a) Describe how an array is stored in memory. (b) Define a string, and describe how strings are stored. (c) Describe the implications of reading

More information

Note: If only one statement is to be followed by the if or else condition then there is no need of parenthesis.

Note: If only one statement is to be followed by the if or else condition then there is no need of parenthesis. Birla Institute of Technology & Science, Pilani Computer Programming (CSF111) Lab-4 ---------------------------------------------------------------------------------------------------------------------------------

More information

Control Statements. If Statement if statement tests a particular condition

Control Statements. If Statement if statement tests a particular condition Control Statements Control Statements Define the way of flow in which the program statements should take place. Implement decisions and repetitions. There are four types of controls in C: Bi-directional

More information

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan Lecture 08-1 Programming in C++ PART 1 By Assistant Professor Dr. Ali Kattan 1 The Conditional Operator The conditional operator is similar to the if..else statement but has a shorter format. This is useful

More information

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1

ADARSH VIDYA KENDRA NAGERCOIL COMPUTER SCIENCE. Grade: IX C++ PROGRAMMING. Department of Computer Science 1 NAGERCOIL COMPUTER SCIENCE Grade: IX C++ PROGRAMMING 1 C++ 1. Object Oriented Programming OOP is Object Oriented Programming. It was developed to overcome the flaws of the procedural approach to programming.

More information

Loops / Repetition Statements

Loops / Repetition Statements Loops / Repetition Statements Repetition statements allow us to execute a statement multiple times Often they are referred to as loops C has three kinds of repetition statements: the while loop the for

More information

بسم اهلل الرمحن الرحيم

بسم اهلل الرمحن الرحيم بسم اهلل الرمحن الرحيم Fundamentals of Programming C Session # 10 By: Saeed Haratian Fall 2015 Outlines Examples Using the for Statement switch Multiple-Selection Statement do while Repetition Statement

More information

C Programming Class I

C Programming Class I C Programming Class I Generation of C Language Introduction to C 1. In 1967, Martin Richards developed a language called BCPL (Basic Combined Programming Language) 2. In 1970, Ken Thompson created a language

More information

Introduction to C Programming. Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan

Introduction to C Programming. Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan Introduction to C Programming Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan Outline Printing texts Adding 2 integers Comparing 2 integers C.E.,

More information

EC 413 Computer Organization

EC 413 Computer Organization EC 413 Computer Organization C/C++ Language Review Prof. Michel A. Kinsy Programming Languages There are many programming languages available: Pascal, C, C++, Java, Ada, Perl and Python All of these languages

More information

Chapter 8. More Control Statements

Chapter 8. More Control Statements Chapter 8. More Control Statements 8.1 for Statement The for statement allows the programmer to execute a block of code for a specified number of times. The general form of the for statement is: for (initial-statement;

More information

Repetition and Loop Statements Chapter 5

Repetition and Loop Statements Chapter 5 Repetition and Loop Statements Chapter 5 1 Chapter Objectives To understand why repetition is an important control structure in programming To learn about loop control variables and the three steps needed

More information

Chapter 4. Flow of Control

Chapter 4. Flow of Control Chapter 4. Flow of Control Byoung-Tak Zhang TA: Hanock Kwak Biointelligence Laboratory School of Computer Science and Engineering Seoul National Univertisy http://bi.snu.ac.kr Sequential flow of control

More information

Other Loop Options EXAMPLE

Other Loop Options EXAMPLE C++ 14 By EXAMPLE Other Loop Options Now that you have mastered the looping constructs, you should learn some loop-related statements. This chapter teaches the concepts of timing loops, which enable you

More information

CSE123 LECTURE 3-1. Program Design and Control Structures Repetitions (Loops) 1-1

CSE123 LECTURE 3-1. Program Design and Control Structures Repetitions (Loops) 1-1 CSE123 LECTURE 3-1 Program Design and Control Structures Repetitions (Loops) 1-1 The Essentials of Repetition Loop Group of instructions computer executes repeatedly while some condition remains true Counter-controlled

More information

Programming Fundamentals

Programming Fundamentals Programming Fundamentals Programming Fundamentals Instructor : Zuhair Qadir Lecture # 11 30th-November-2013 1 Programming Fundamentals Programming Fundamentals Lecture # 11 2 Switch Control substitute

More information

Chapter 1 & 2 Introduction to C Language

Chapter 1 & 2 Introduction to C Language 1 Chapter 1 & 2 Introduction to C Language Copyright 2007 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 1 & 2 - Introduction to C Language 2 Outline 1.1 The History

More information

Midterm Exam. CSCI 2132: Software Development. March 4, Marks. Question 1 (10) Question 2 (10) Question 3 (10) Question 4 (10) Question 5 (5)

Midterm Exam. CSCI 2132: Software Development. March 4, Marks. Question 1 (10) Question 2 (10) Question 3 (10) Question 4 (10) Question 5 (5) Banner number: Name: Midterm Exam CSCI 2132: Software Development March 4, 2019 Marks Question 1 (10) Question 2 (10) Question 3 (10) Question 4 (10) Question 5 (5) Question 6 (5) Total (50) Instructions:

More information

C 101. Davide Vernizzi. April 29, 2011

C 101. Davide Vernizzi. April 29, 2011 C 101 Davide Vernizzi April 9, 011 1 Input/Output Basic I/O. The basic I/O shown here can be used to get input from the user and to send output to the user. Note that usually input must be verified before

More information

CHAPTER 2.2 CONTROL STRUCTURES (ITERATION) Dr. Shady Yehia Elmashad

CHAPTER 2.2 CONTROL STRUCTURES (ITERATION) Dr. Shady Yehia Elmashad CHAPTER 2.2 CONTROL STRUCTURES (ITERATION) Dr. Shady Yehia Elmashad Outline 1. C++ Iterative Constructs 2. The for Repetition Structure 3. Examples Using the for Structure 4. The while Repetition Structure

More information

Dept. of CSE, IIT KGP

Dept. of CSE, IIT KGP Control Flow: Looping CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Types of Repeated Execution Loop: Group of

More information

5. Selection: If and Switch Controls

5. Selection: If and Switch Controls Computer Science I CS 135 5. Selection: If and Switch Controls René Doursat Department of Computer Science & Engineering University of Nevada, Reno Fall 2005 Computer Science I CS 135 0. Course Presentation

More information

OER on Loops in C Programming

OER on Loops in C Programming OER on Loops in C Programming Prepared by GROUP ID 537 B. Bala Nagendra Prasad (bbalanagendraprasad@gmail.com C. Naga Swaroopa (swarupabaalu@gmail.com) L. Hari Krishna (lhkmaths@gmail.com) 1 Table of Contents

More information