Break and continue statement in C

  • 137 views
Uploaded on

Explanation of break and continue statements in C language.

Explanation of break and continue statements in C language.

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
137
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
6
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Break and Continue statement
  • 2. Break Statement
  • 3. June Result Re-valuation Result December Result Normal Study Period Study Period if subject is cleared in the revaluation process
  • 4. #include<stdio.h> #include<conio.h> main() { ………………………………. ………………………………. ………………………………. while(condition) { ……………. ……………. If condition becomes true if(condition) break; ……………. ……………. ……………. increment or decrement; } …………………………………. …………………………………. …………………………………. getch(); }
  • 5. Prime Number . , , , , ….! , , , , , , , : , ….!
  • 6. #include<stdio.h> #include<conio.h> void main() { int num, i; clrscr(); printf(“Enter Numbert”); scanf(“%d”, &num); i = 2; while(i < num – 1) { if(num % i == 0) { printf(“Numbers is not primen”); break; } i++; } if(i == num) printf(“Number is primen”); getch(); }
  • 7. Enter Number Number is prime _ 5
  • 8. Enter Number Number is prime _ 37
  • 9. Enter Number Number is Not prime Number is prime _ 25
  • 10. Enter Number Number is Not prime _ 25
  • 11. #include<stdio.h> #include<conio.h> void main() { int num, i; clrscr(); printf(“Enter Numbert”); scanf(“%d”, &num); i = 2; while(i < num – 1) { if(num % i == 0) { printf(“Numbers is not primen”); break; } i++; } if(i == num) printf(“Number is primen”); getch(); } 25 num 2 i
  • 12. Continue statement for(i = 1; i < 10; i++) { do this; If condition is do this; true if(condition) continue; do this; If condition is do this; false }
  • 13. 5 10 15 20 25 30 35 40 45 50 _
  • 14. #include<stdio.h> #include<conio.h> void main() { int j; clrscr(); for(j=1; j<=50; j++) { if(j % 5 != 0) continue; printf(“%dn”, j); } getch(); } When j is not divisible by 5