Skip to content
Programming101
Programmingoneonone

Learn everything about programming

  • Home
  • CS Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programmingoneonone

Learn everything about programming

C program to illustrates the use of continue statement

YASH PAL, 31 July 2024

In this tutorial, we are going to write a C Program to illustrates the use of continue statement in C Programming with practical program code and step-by-step full complete explanation.

C Program to illustrates the use of continue statement

C Program to illustrates the use of continue statement.

 
#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{
    int count, negative;
    double number, sqroot;

    printf("Enter 9999 to STOPn");
    count=0;
    negative=0;

    while(count<=100)
    {
        printf("Enter a number: ");
        scanf("%f",&number);

        if(number==9999)
            break;

        if(number<0)
        {
            printf("Number is negativen");
            negative++;
            continue;
        }

        sqroot=sqrt(number);
        printf("Number=%1f square root=%1fn",number,sqroot);
        count++;
    }

    printf("Number of items done=%dn",count);
    printf("Negative items=%dn",negative);
    printf("END OF DATA");
}

Output

 
Enter 9999 to STOP
Enter a number: 25.0
Number = 25.000000
Square root = 5.000000
Enter a number: 40.5
Number = 40.500000
Square root = 6.363961
Enter a number: -9
Number is negative
Enter a number: 16
Number = 16.000000
Square root = 4.000000
Enter a number: -14.75
Number is negative
Enter a number: 80
Number = 80.000000
Square root = 8.944272

Enter a number: 9999
Number of items done = 4
Negative items = 2
END OF DATA
c coding problems solutions

Post navigation

Previous post
Next post

Pages

  • About US
  • Contact US
  • Privacy Policy

Programing Practice

  • C Programs
  • java Programs

HackerRank Solutions

  • C
  • C++
  • Java
  • Python
  • Algorithm

Other

  • Leetcode Solutions
  • Interview Preparation

Programming Tutorials

  • DSA
  • C

CS Subjects

  • Digital Communication
  • Human Values
  • Internet Of Things
  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2025 Programmingoneonone | WordPress Theme by SuperbThemes