SlideShare a Scribd company logo
C  programming flow of controls
EXTRA
NOTES
NOTES
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int age; 
clrscr(); 
printf(“Enter agen”); 
scanf(“%d”, &age); 
if(age>=18) 
{ 
printf(“Eligible for Vote”); 
} 
else 
{ 
printf(“Not Eligible for Vote”); 
} 
getch(); 
} 
EXTRA
EXTRA
NOTES
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int age; 
clrscr(); 
printf(“Enter agen”); 
scanf(“%d”, &age); 
if(age>=18) 
{ 
if(age>=25) 
{ 
printf(“Eligible for Vote & Marriage ”); 
} 
else 
{ 
printf(“Eligible for Vote but not Marriage ”); 
} 
} 
else 
{ 
printf(“Not Eligible for Vote & Marriage”); 
} 
getch(); 
} 
EXTRA
EXTRA
NOTES
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int roll; 
clrscr(); 
printf(“Enter Roll Non”); 
scanf(“%d”, &roll); 
switch(roll) 
{ 
case 1: printf(“Raj”); 
break; 
case 2: printf(“Anita”); 
break; 
case 3: printf(“Babita”); 
break; 
default: printf(“Invalid Roll No”); 
} 
getch(); 
} 
EXTRA
if condition & Go to statement 
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int a=1; 
clrscr(); 
start: 
printf(“%dn”,a++); 
if(a<=10) 
goto start; 
getch(); 
} 
EXTRA
NOTES
NOTES
EXTRA
NOTES
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int i; 
clrscr(); 
for(i=1;i<=10;i++) 
{ 
printf(“%dn”,i); 
} 
getch(); 
} 
EXTRA
EXTRA
NOTES
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int i=1,n=2; 
clrscr(); 
while(i<=10) 
{ 
printf(“%dn”, n*i); 
i++; 
} 
getch(); 
} 
EXTRA
NOTES
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int a=0,b=1,c=0,n=3; 
clrscr(); 
printf(“%d ”,a); 
printf(“%d ”,b); 
do 
{ 
c=a+b; 
printf(“%d ”,c); 
a=b; 
b=c; 
n++; 
} 
while(n<=10); 
getch(); 
} 
EXTRA
NOTES
NOTES
#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
int i; 
clrscr(); 
printf(“the loop with break produces output as n”); 
for(i=1;i<=10;i++) 
{ 
if(i%3==0) 
{ 
break; 
} 
else 
{ 
printf(“%dn”,i); 
} 
} 
prinf(“The loop with continue produces output asn”); 
for(i=1;i<=10;i++) 
{ 
if(i%3==0) 
{ 
continue; 
} 
else 
{ 
printf(“%dn”,i); 
} 
} 
getch(); 
} 
EXTRA

More Related Content

PDF
Infitopost notepad
PDF
Alocação Dinâmica em C
TXT
Bai lam chuong 3
PDF
DOCX
PDF
Heep implementation in c
Infitopost notepad
Alocação Dinâmica em C
Bai lam chuong 3
Heep implementation in c

Viewers also liked (20)

PPSX
Php opps
PPSX
COMPUTER Tips ‘n’ Tricks
PPSX
VISUAL BASIC .net iv
PPSX
PPSX
VISUAL BASIC .net ii
PPSX
Virus examples
PPSX
PPSX
C programming file handling
PPSX
TALLY Service tax & tds ENTRY
PPSX
Multimedia basic
PPSX
VISUAL BASIC .net i
PPSX
Application software
PPSX
Php basic
PPSX
1 tally basic
PPSX
TALLY 1 st level entry
PPSX
TALLY Payroll ENTRY
PPSX
VISUAL BASIC .net vi
PPSX
VISUAL BASIC .net iii
PPSX
Php oops1
PPSX
Computer development
Php opps
COMPUTER Tips ‘n’ Tricks
VISUAL BASIC .net iv
VISUAL BASIC .net ii
Virus examples
C programming file handling
TALLY Service tax & tds ENTRY
Multimedia basic
VISUAL BASIC .net i
Application software
Php basic
1 tally basic
TALLY 1 st level entry
TALLY Payroll ENTRY
VISUAL BASIC .net vi
VISUAL BASIC .net iii
Php oops1
Computer development
Ad

More from argusacademy (20)

PPSX
Css & dhtml
PPSX
Html table
PPSX
Html ordered & unordered list
PPSX
Html level ii
PPSX
Html frame
PPSX
Html forms
PPSX
Html creating page link or hyperlink
PPSX
Html basic
PPSX
Java script
PPSX
Php string
PPSX
Php session
PPSX
Php if else
PPSX
Php creating forms
PPSX
Php create and invoke function
PPSX
Php array
PPSX
Sql query
PPSX
PDF
Oracle
PDF
Vb.net iv
PDF
Vb.net iii
Css & dhtml
Html table
Html ordered & unordered list
Html level ii
Html frame
Html forms
Html creating page link or hyperlink
Html basic
Java script
Php string
Php session
Php if else
Php creating forms
Php create and invoke function
Php array
Sql query
Oracle
Vb.net iv
Vb.net iii
Ad

Recently uploaded (7)

PDF
فێرکردن و فێربوونی مۆدێرن.pdf دەروازەیەک بۆ
PPTX
Slide Ibadah siang 29 mei 2025 jika .pptx
PDF
ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯSri Kshetra Champakadham Swamy Temple
PPTX
science grade 7 quiz_Scientific Method.pptx
PPTX
Tahfidz Qur’an TIMING tampa musik bagian 2.pptx
PDF
"ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯ""Sri Kshetra Champakadham Swamy Temple"
PPTX
Coklat Beige Ilustrasi 3 Dimensi Tugas Kelompok Presentasi.pptx
فێرکردن و فێربوونی مۆدێرن.pdf دەروازەیەک بۆ
Slide Ibadah siang 29 mei 2025 jika .pptx
ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯSri Kshetra Champakadham Swamy Temple
science grade 7 quiz_Scientific Method.pptx
Tahfidz Qur’an TIMING tampa musik bagian 2.pptx
"ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯ""Sri Kshetra Champakadham Swamy Temple"
Coklat Beige Ilustrasi 3 Dimensi Tugas Kelompok Presentasi.pptx

C programming flow of controls

  • 5. #include<stdio.h> #include<conio.h> void main() { int age; clrscr(); printf(“Enter agen”); scanf(“%d”, &age); if(age>=18) { printf(“Eligible for Vote”); } else { printf(“Not Eligible for Vote”); } getch(); } EXTRA
  • 8. #include<stdio.h> #include<conio.h> void main() { int age; clrscr(); printf(“Enter agen”); scanf(“%d”, &age); if(age>=18) { if(age>=25) { printf(“Eligible for Vote & Marriage ”); } else { printf(“Eligible for Vote but not Marriage ”); } } else { printf(“Not Eligible for Vote & Marriage”); } getch(); } EXTRA
  • 10. NOTES
  • 11. #include<stdio.h> #include<conio.h> void main() { int roll; clrscr(); printf(“Enter Roll Non”); scanf(“%d”, &roll); switch(roll) { case 1: printf(“Raj”); break; case 2: printf(“Anita”); break; case 3: printf(“Babita”); break; default: printf(“Invalid Roll No”); } getch(); } EXTRA
  • 12. if condition & Go to statement #include<stdio.h> #include<conio.h> void main() { int a=1; clrscr(); start: printf(“%dn”,a++); if(a<=10) goto start; getch(); } EXTRA
  • 13. NOTES
  • 14. NOTES
  • 15. EXTRA
  • 16. NOTES
  • 17. #include<stdio.h> #include<conio.h> void main() { int i; clrscr(); for(i=1;i<=10;i++) { printf(“%dn”,i); } getch(); } EXTRA
  • 18. EXTRA
  • 19. NOTES
  • 20. #include<stdio.h> #include<conio.h> void main() { int i=1,n=2; clrscr(); while(i<=10) { printf(“%dn”, n*i); i++; } getch(); } EXTRA
  • 21. NOTES
  • 22. #include<stdio.h> #include<conio.h> void main() { int a=0,b=1,c=0,n=3; clrscr(); printf(“%d ”,a); printf(“%d ”,b); do { c=a+b; printf(“%d ”,c); a=b; b=c; n++; } while(n<=10); getch(); } EXTRA
  • 23. NOTES
  • 24. NOTES
  • 25. #include<stdio.h> #include<conio.h> void main() { int i; clrscr(); printf(“the loop with break produces output as n”); for(i=1;i<=10;i++) { if(i%3==0) { break; } else { printf(“%dn”,i); } } prinf(“The loop with continue produces output asn”); for(i=1;i<=10;i++) { if(i%3==0) { continue; } else { printf(“%dn”,i); } } getch(); } EXTRA