SlideShare a Scribd company logo
1 of 113
Control Structures
● Introduction to Control Structures
Branching and looping structures
● If statement, If-else statement, Nested if-
else, else-if Ladder
● Switch statement
● For loop, While loop, Do while loop
● break and continue
 A statement that is used to control the flow
of execution in a program is called control
structure.
 The control statements help users specify the
order of execution of the instructions present
in a program.
 Instead of executing statements in order,
control structures will allow us to jump to
other places in the program.
 if statement
 if-else statement
 nested if-else statement
 switch statement
 Used to execute a statement or a set of
statements conditionally.
 If the condition, whatever it is, is true, then
the statement is executed.
 If the condition is not true then the statement
is not executed and control transfers to the
next executable statements, outside the body
of if.
Syntax:
if(condition)
{
statements
}
statement_x;
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf(“enter a number :”);
scanf(“%d”,&a);
if(a>=0)
{
printf(“number is +ve”);
}
getch();
}
Question 1:
Write a program to check if given number is
even.
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf(“enter a number :”);
scanf(“%d”,&a);
if(a%2==0)
{
printf(“number is even”);
}
getch();
}
Question 2:
While purchasing certain items, a discount of
10% is offered if quantity purchased is more
than 1000. Accept quantity and price from
user, write a program to calculate the total
expenses.
#include<stdio.h>
#include<conio.h>
void main()
{
int q, dis=0;
float r total;
printf(“enter quantity:”);
scanf(“%d”,&q,);
printf(“enter rate:”);
scanf(“%f”,&r,);
if(q>1000)
{
dis=10;
}
total=q*r-q*r*dis/100;
printf(“Expenses=%f”,total);
getch();
}
Question 3:
Write program that print largest among three
numbers
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,max;
printf(“enter 3 numbers :”);
scanf(“%d %d %d”,&a,&b,&c);
max=a;
if(b>max)
max=b;
if(c>max)
max=c
printf(“largest number=%d”,max);
getch();
}
 If there are two statements
to be executed
alternatively, then if-else
statement is used.
 If the Boolean expression
evaluates to true, then
the if block will be
executed, otherwise,
the else block will be
executed.
Syntax:
if(condition)
{
statement1;
}
else
{
statement2;
}
statement_x;
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf(“enter a number :”);
scanf(“%d”,&a);
if(a>=0)
{
printf(“number is +ve”);
}
else
{
printf(“number is –ve”);
}
getch();
}
Question 1:
Write a program to check if given number is
even or odd
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf(“enter a number :”);
scanf(“%d”,&a);
if(a%2==0)
{
printf(“number is even”);
}
else
{
printf(“number is odd”);
}
getch();
}
Question 2:
While purchasing certain items, a discount of
10% is offered if quantity purchased is more
than 1000. Accept quantity and price from
user, write a program to calculate the total
expenses.
#include<stdio.h>
#include<conio.h>
void main()
{
int q;
float r total;
printf(“enter quantity:”);
scanf(“%d”,&q,);
printf(“enter rate:”);
scanf(“%f”,&r,);
if(a>1000)
{
total=q*r-q*r*10/100;
}
else
{
total=q*r
}
printf(“Expenses=%f”,total);
getch();
}
Question 3:
Write program that print largest among two
numbers
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf(“enter 2 numbers :”);
scanf(“%d %d”,&a,&b);
if(a>b)
{
printf(“largest number=%d”,a);
}
else
{
printf(“largest number=%d”,b);
}
getch();
}
Question 4:
Write program to check whether input entered
is alphabet or not
#include<stdio.h>
#include<conio.h>
void main()
{
char key;
printf(“enter any key:”);
scanf(“%c”,&key);
if((key>=‘A’ && key<=‘Z’) || (key>=‘a’ && key<=‘z’) )
{
printf(“Entered key is alphabet”);
}
else
{
printf(“Entered key is not alphabet”);
}
getch();
}
 nested if_else
 else_if ladder
 switch statements.
syntax:
if(condition)
{
if(condition)
{
statement1;
}
else
{
statement2;
}
}
else
{
if(condition)
{
statement3;
}
else
{
statement4;
}
}
Statement x;
#include <stdio.h>
void main()
{
int numb1, numb2;
printf("enter two integers to checkn");
scanf("%d %d",&numb1,&numb2);
if(numb1==numb2)
{
printf("result: %d = %d",numb1,numb2);
}
else
if(numb1>numb2)
{
printf("result: %d > %d",numb1,numb2);
}
else
{
printf("result: %d > %d",numb2,numb1);
}
}
Question 1:
Write a program to check whether a number
given by user is zero, positive or negative
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf(“enter a number :”);
scanf(“%d”,&a);
if(a==0)
{
printf(“number is zero”);
}
else
{
if(a>0)
{
printf(“number is positive”);
}
else
{
printf(“number is negative”);
}
}
getch();
}
Question 2 :
To find greatest of three numbers using nested
if_else.
#include <stdio.h>
void main()
{
int a,b,c;
printf("Enter 3 numbers: n");
scanf("%d %d %d",&a,&b,&c);
if(a>=b)
{
if(a>=c)
printf("%d is largest",a);
else
printf("%d is largest",c);
}
else
{
if(b>=c)
printf("%d is largest",b);
else
printf("%d is largest",c);
}
Question 3:
Write a program to check whether the enter
alphabet is uppercase or lowercase characters
using nested if_else.
#include <stdio.h>
void main()
{
char ch;
printf("Enter any character: ");
scanf("%c", &ch);
if(ch >= 'A' && ch <= 'Z')
{
printf("%c is uppercase alphabet.n", ch);
}
else
{
if(ch >= 'a' && ch <= 'z')
{
printf("%c is lowercase alphabet.n", ch);
}
else
{
printf("%c is not an alphabet.n", ch);
}
}
}
Syntax:
if(test_condition1)
{
statement 1;
}
else if(test_condition2)
{
statement 2;
}
else if(test_condition3)
{
statement 3;
}
else if(test_condition4)
{
statement 4;
else
{
statement x;
}
 Question
Accept temperature from user and print
accordingly
 Its very cold(if temperature<=0)
 Its cold (if temperature is between 1 to 10)
 Its cool out (if temperature is between 11 to
20)
 Its warm (if temperature is between 21 to 30)
 If all above conditions are false then print its
hot
#inlcude<stdio.h>
#include<conio.h>
void main()
{
float T;
printf("Enter The Temperature");
scanf("%f",&T);
if(T<=0)
{
printf("Its very very cold");
}
else if(T>0 && T<=10)
{
printf("Its cold");
}
else if(T>10 && T < =20)
{
printf("Its cool out");
}
else if(T<=30 && T>20)
{
printf("Its warm");
}
else
{
printf("Its hot");
}
getch();
}
Question 1:
Accept time from user and print accordingly
 Good morning (1am-12pm)
 Good after noon (12pm -16pm)
 Good evening (16pm to 19pm)
 Good night ( 19pm to 24pm)
#include<stdio.h>
#include<conio.h>
void main()
{
float time;
clrscr();
printf("enter time for1 to 24 hr clock ");
scanf("%f",&time);
if(time>=0&&time<12)
printf("Good Morning!!!");
else if(time>=12&&time<16)
printf("Good Afternoon!!!");
else if(time>=16&&time<19)
printf("Good Evening!!!");
else if(time>=19&&time<24)
printf("Good Night!!!");
else
printf("Wrong time");
getch();
}
 Question 2:
Write a program to accept number from user,
if number=1 print red
number=2 print green
number=3 print yellow
number=4 print blue
#include<stdio.h>
void main()
{
int n;
printf(" Enter 1 to 4 to select random color");
scanf("%d",&n);
if(n==1)
{
printf("You selected Red color");
}
else if(n==2)
{
printf("You selected Green color");
}
else if(n==3)
{
printf("You selected yellow color");
}
else if(n==4)
{
printf("You selected Blue color");
}
else
{
printf("No color selected");
}
}
 Question 3:
WAP to accept 1-6 numbers from user and
print spelling of respective number.
#include <stdio.h>
main ( )
{
int x;
printf("enter an integer between 1 and 6“);
scanf(“%d”,&x);
if(x==1)
printf("the number is one”);
else if(x==2)
printf("the number is two”);
else if(x==3)
printf("the number is three”);
else if(x==4)
printf("the number is four”);
else if(x==5)
printf("the number is five”);
else if(x==6)
printf("the number is six”);
else
printf("you didn't follow the rules“);
}
 The switch statement
causes a particular group
of statement to be chosen
from several available
groups.
 The selection is based
upon the value of an
expression, int variable or
character variable which is
included in the switch
statement.
switch(expression)
{
case constant-expression_1 : statement(s);
break;
case constant-expression_2 : statement(s);
break;
case constant-expression_n : statement(s);
break;
default : default_block; //optional
}
#include<stdio.h>
#include<conio.h>
void main()
{
char choice;
printf("n Enter your choice");
scanf("%c",&choice);
switch(choice)
{
case 'r':printf("n Red");
break;
case 'w':printf("n White");
break;
case 'b':printf("n Blue");
break;
default:printf("n wrong choice");
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
char choice;
printf("n Enter your choice");
scanf("%c",&choice);
switch(choice)
{
case ‘R’:
case 'r':printf("n Red");
break;
case ‘W’:
case 'w':printf("n White");
break;
case ‘B’:
case 'b':printf("n Blue");
break;
default:printf("n wrong choice");
}
getch();
}
 Question 1:
WAP to accept 1-6 numbers from user and
print spelling of respective number using
switch case.
#include<stdio.h>
#include<conio.h>
void main()
{
int choice;
printf("n Enter your choice");
scanf("%d",&choice);
switch(choice)
{
case 1:printf("n One");
break;
case 2:printf("n Two");
break;
case 3:printf("n Three");
break;
case 4:printf("n Four");
break;
case 5:printf("n Five");
break;
case 6:printf("n Six");
break;
default:printf("n wrong choice");
}
getch();
}
 Question 2:
WAP to print number of days in a month using
switch case
#include <stdio.h>
int main()
{
int month;
printf("Enter month number(1-12): ");
scanf("%d", &month);
switch(month)
{
case 1: printf("31 days");
break;
case 2: printf("28/29 days");
break;
case 3: printf("31 days");
break;
case 4: printf("30 days");
break;
case 5: printf("31 days");
break; contd…
case 6: printf("30 days");
break;
case 7: printf("31 days");
break;
case 8: printf("31 days");
break;
case 9: printf("30 days");
break;
case 10: printf("31 days");
break;
case 11: printf("30 days");
break;
case 12: printf("31 days");
break;
default: printf("Invalid input! Please enter month number between 1-12");
}
}
#include <stdio.h>
void main()
{
int month;
printf("Enter month number(1-12): ");
scanf("%d", &month);
switch(month)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12: printf("31 days");
break;
case 4:
case 6:
case 9:
case 11: printf("30 days");
break;
case 2: printf("28/29 days");
break;
default: printf("Invalid input! Please enter month number between 1-12");
}
}
Write a menu driven program for basic
arithmetic operations( Addition, Subtraction,
Multiplication & Division).
#include<stdio.h>
void main()
{
float num1,num2,ans;
int opt;
printf("nEnter the First Number : ");
scanf("%f",&num1);
printf("nEnter the Second Number : ");
scanf("%f",&num2);
printf(“1.Additionn2.Subtractionn3.Multiplyn4.Divide
n5.Exit");
printf("nEnter your choice : ");
scanf("%d",&opt);
switch(opt)
{ contd…
case 1:
ans = num1+num2;
printf("nThe addition of 2 numbers is : %f",ans);
break;
case 2:
ans = num1-num2;
printf("nThe differnce of 2 numbers is : %f",ans);
break;
case 3:
ans = num1*num2;
printf("nThe product of 2 numbers is : %f",ans);
break;
case 4:
ans = num1/num2;
printf("nThe division of 2 numbers is : %f",ans);
break;
default:
printf("nYou Entered Wrong Choicen");
}
}
 Question 3:
WAP to perform bitwise operations using
switch case.
#include<stdio.h>
#include<conio.h>
void main()
{
int c,a,b,result;
clrscr();
printf("Enter a and b");
scanf("%d %d",&a,&b);
printf("Enter your choice");
scanf("%d",&c);
switch(c)
{
case 1:
result=a&b;
printf("result=%d",result);
break;
case 2:
result=a|b;
printf("result=%d",result);
break;
….contd
case 3:
result=a^b;
printf("result=%d",result);
break;
case 4:
result=a<<2;
printf("result=%d",result);
break;
case 5:
result=a>>2;
printf("result=%d",result);
break;
case 6:
result=~a;
printf("result=%d",result);
break;
default:
printf("Enter valid choice");
}
getch();
}
 Taking control back to previous statement is
known as ‘looping’.
 Looping is also called a repetitive or iterative
control mechanism.
 Parts of loop: 1. body of the loop
2. Control statement
 If the control statement is placed before the
body of the loop, it is called entry-controlled
loop.
 If the control statement is placed after the
body of the loop, it is called exit-controlled
loop.
 Initialization
To set the initial value for the loop counter.
 Decision
An appropriate test condition to determine
whether the loop be executed or not.
 Updation
incrementing or decrementing the counter
value.
 The while statement
 The do-while statement
 The for statement
 This is used to execute a set of statements
repeatedly as long as the specified condition
is true.
 It is entry-controlled loop.
 If the loop condition evaluates to be true,
then the statements will be executed.
 If the loop condition evaluates to be false,
control will go to the first statement after
curly bracket.
Syntax:
initialize the variable;
while(condition)
{
statements;
increment/decrement;
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
i=0; // initialize the variable
while(i<5)
{
printf("%dn",i);
i++; // increment/decrement
}
getch();
}
 Question1
 Write a program to print HELLO WORLD 5
times using while loop
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
i=0;
while(i<5)
{
printf(“HELLO WORLD”);
i++;
}
getch();
}
 Question2
Write a program to print ten consecutive
numbers in reverse order using while loop.
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
i=10;
while(i>0)
{
printf("%d",i);
i--;
}
getch();
}
 Question3
 Write a program to print Fibonacci series of n
numbers using while loop.
e.g 0 1 1 2 3 5 8 13...
// 0 1 1 2 3 5 8 13...
#include<stdio.h>
void main()
{
int n,i,a,b,c;
printf("Enter a number: ");
scanf("%d",&n);
i=1;
a=0;
b=1;
while(i<=n)
{
printf("%d ",a);
c = a + b;
a = b;
b = c;
i++;
}
}
 It is exit-controlled loop.
 When the loop is constructed using the while
loop, the condition in the loop will be
checked first and then the control will go in
side the loop.
 The do-while loop will be executed whether
or not the condition in the loop is true at
least for one time.
Syntax:
initialize the variable;
do
{
statements;
increment/decrement;
}
while(condition);
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
i=0;
do
{
printf("%dt",i);
++i;
}
while(i<5);
getch();
}
 Question1:
Write a program to print first 10 even number
using do-while loop.
#include<stdio.h>
#include<conio.h>
void main()
{
int x = 1;
do
{
if(x%2==0)
printf(“ %dn",x);
x++;
}while(x <= 20);
getch();
}
 Question2:
Write a program to find palindrome of
given number using do-while loop.
An integer is a palindrome if the reverse of that
number is equal to the original number.
e.g 1221
#include<stdio.h>
void main()
{
int n,a,r,s=0;
printf("n Enter The Number:");
scanf("%d",&n);
a=n;
do
{
r=n%10;
s=s*10+r;
n=n/10;
} while(n>0);
if(a==s)
{ printf("n %d is a Palindrome Number",a); }
else
{ printf("n %d is a not Palindrome Number",a); }
}
Question3
Write a program to find whether given
number is Armstrong or not using do-
while loop.(egs. 153,371,1634)
In the case of an Armstrong number of 3 digits,
the sum of cubes of each digit is equal to the
number itself. For example, 153 is an Armstrong
number because
153 = 1*1*1 + 5*5*5 + 3*3*3
#include<stdio.h>
#include<conio.h>
void main()
{
int n,c,d,s=0,num;
clrscr();
printf("n Enter Any Number : ");
scanf("%d",&n);
num=n;
do
{
d=n%10;
c=d*d*d;
s=s+c;
n=n/10;
} while(n!=0);
if(s==num)
printf("n %d is Armstrong Number",num);
else
printf("n %d is Not an Armstrong Number",num);
getch();
}
 A for loop is a repetition control structure that allows
you to efficiently write a loop that needs to execute a
specific number of times.
 Initialization step allows you to declare and initialize
any loop control variables.
 Next, the condition is evaluated. If it is true, the body of
the loop is executed. If it is false, the body of the loop
does not execute and the flow of control jumps to the
next statement just after the 'for' loop.
 After the body of the 'for' loop executes, the flow of
control jumps back up to the increment statement.
Syntax:
for(initialization; test_condition; increment/decrement)
{
code to be executed;
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i=0;i<5;i++)
{
printf("%dn",i);
}
getch();
}
Question 1
Write a program to find sum of first 10
numbers using for loop.
#include<stdio.h>
void main()
{
int n,j,sum=0;
clrscr();
printf("Enter the Number : ");
scanf("%d",&n);
for(j=1;j<=n;j++)
{
printf("%d ",j);
sum=sum+j;
}
printf("nSum of %d is : %d ",n,sum);
getch();
}
 Question 2
 Write a program to generate the
multiplication table of a number (entered by
the user) using for loop.
#include <stdio.h>
void main()
{
int n, i;
printf("Enter an integer: ");
scanf("%d",&n);
for(i=1; i<=10; ++i)
{
printf("%d * %d = %d n", n, i, n*i);
}
}
 Question 3
 Write a program to find factorial of given
number using for loop.
The factorial of a positive number n is given by:
factorial of n (n!) = 1 * 2 * 3 * 4....n
The factorial of a negative number doesn't exist.
And, the factorial of 0 is 1.
#include<stdio.h>
void main()
{
int i,f=1,num;
printf("Enter a number: ");
scanf("%d",&num);
for(i=1;i<=num;i++)
f=f*i;
printf("Factorial of %d is: %d",num,f);
}
Nested for
Loops
 C programming allows to use one loop inside
another loop.
 Syntax :
for ( init; condition; increment )
{
for ( init; condition; increment )
{
statement(s);
}
statement(s);
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%dt",i+j);
}
printf("n");
}
getch();
}
 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.
 It can be used to terminate a case in
the switch statement.
 Syntax: break;
#include <stdio.h>
void main ()
{
int a = 10;
/* while loop execution */
while( a < 20 )
{
printf("value of a: %dn", a);
a++;
if( a > 15)
{
/* terminate the loop using break statement */
break;
}
}
getch();
}
 The continue statement in C programming
works somewhat like the break statement.
 Instead of forcing termination, it forces the
next iteration of the loop to take place,
skipping any code in between.
 Syntax : continue;
#include <stdio.h>
void main ()
{
int a = 10;
/* do while loop execution */
do
{
if( a == 15)
{
/* skip the iteration */
a = a + 1;
continue;
}
printf("value of a: %dn", a);
a++;
} while( a < 20 );
}
 A goto statement in C
programming provides an
unconditional jump from
the 'goto' to a labeled
statement in the same
function.
 Syntax :
#include<stdio.h>
#include<conio.h>
void main()
{
int age;
Vote: //lable
printf("you are eligible for voting");
NoVote: //lable
printf("you are not eligible to vote");
printf("Enter you age:");
scanf("%d", &age);
if(age>=18)
goto Vote;
else
goto NoVote;
getch();
}
 Use of goto statement is
highly discouraged in any
programming language
because it makes difficult
to trace the control flow of
a program, making the
program hard to
understand and hard to
modify.
 Any program that uses a
goto can be rewritten to
avoid them.
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
for(i=1;i<=13;i++)
{
if(i%2==0)
{
printf("*");
}
else
{
printf("/");
}
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,flag=1;
clrscr();
for(i=1;i<=4;i++)
{
for(j=1;j<=i;j++)
{
printf("%dt",flag);
flag++;
}
printf("n");
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%ct",(char)(j+64));
}
printf("n");
}
getch();
}
1
2 1
1 2 3
4 3 2 1
1 2 3 4 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1;i<=5;i++)
{
k=i;
for(j=1;j<=i;j++)
{
if(i%2==0)
{
printf("%dt",k);
k--;
}
else
{
printf("%dt",j);
}
}
printf("n");
}
getch();
}
A
BC
DEF
GHIJ
KLMNO
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,flag=1;
clrscr();
for(i=1;i<=5;i++)
{
for(k=4;k>=i;k--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("%c",(char)(flag+64));
flag++;
}
printf("n");
}
getch();
}

More Related Content

Similar to CONTROL STRUCTURES GUIDE

Simple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladderSimple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladderMoni Adhikary
 
Branching statements
Branching statementsBranching statements
Branching statementsArunMK17
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in Csana shaikh
 
Control structure of c
Control structure of cControl structure of c
Control structure of cKomal Kotak
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionalish sha
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionalish sha
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C LanguageShaina Arora
 
Programming Fundamentals Decisions
Programming Fundamentals  Decisions Programming Fundamentals  Decisions
Programming Fundamentals Decisions imtiazalijoono
 
CONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptCONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptSanjjaayyy
 
exp227-jan-170127160848 (3) (1).pdf
exp227-jan-170127160848 (3) (1).pdfexp227-jan-170127160848 (3) (1).pdf
exp227-jan-170127160848 (3) (1).pdfmounikanarra3
 
Loop's definition and practical code in C programming
Loop's definition and  practical code in C programming Loop's definition and  practical code in C programming
Loop's definition and practical code in C programming DharmaKumariBhandari
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C ProgrammingKamal Acharya
 
Programming fundamental 02
Programming fundamental 02Programming fundamental 02
Programming fundamental 02Suhail Akraam
 
3-Conditional-if-else-switch btech computer in c.pdf
3-Conditional-if-else-switch btech computer in c.pdf3-Conditional-if-else-switch btech computer in c.pdf
3-Conditional-if-else-switch btech computer in c.pdfArkSingh7
 

Similar to CONTROL STRUCTURES GUIDE (20)

Simple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladderSimple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladder
 
3. control statement
3. control statement3. control statement
3. control statement
 
Branching statements
Branching statementsBranching statements
Branching statements
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
CH-4 (1).pptx
CH-4 (1).pptxCH-4 (1).pptx
CH-4 (1).pptx
 
Control structures in c
Control structures in cControl structures in c
Control structures in c
 
if,loop,switch
if,loop,switchif,loop,switch
if,loop,switch
 
Control structure of c
Control structure of cControl structure of c
Control structure of c
 
Decision Making and Branching
Decision Making and BranchingDecision Making and Branching
Decision Making and Branching
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selection
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selection
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
Programming Fundamentals Decisions
Programming Fundamentals  Decisions Programming Fundamentals  Decisions
Programming Fundamentals Decisions
 
CONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptCONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.ppt
 
exp227-jan-170127160848 (3) (1).pdf
exp227-jan-170127160848 (3) (1).pdfexp227-jan-170127160848 (3) (1).pdf
exp227-jan-170127160848 (3) (1).pdf
 
3. chapter ii
3. chapter ii3. chapter ii
3. chapter ii
 
Loop's definition and practical code in C programming
Loop's definition and  practical code in C programming Loop's definition and  practical code in C programming
Loop's definition and practical code in C programming
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C Programming
 
Programming fundamental 02
Programming fundamental 02Programming fundamental 02
Programming fundamental 02
 
3-Conditional-if-else-switch btech computer in c.pdf
3-Conditional-if-else-switch btech computer in c.pdf3-Conditional-if-else-switch btech computer in c.pdf
3-Conditional-if-else-switch btech computer in c.pdf
 

Recently uploaded

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 

Recently uploaded (20)

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 

CONTROL STRUCTURES GUIDE