# C Programming Code Examples

## Learn C Language

### Continue Statement in C Programming Language

**Continue Statement in C**

**Syntax for Continue Statement in C**

//loop statements
continue;
//some lines of the code which is to be skipped

/* The continue statement skips the current iteration of the loop and continues with the next iteration. */
// Program to calculate the sum of numbers (10 numbers max)
// If the user enters a negative number, it's not added to the result
#include <stdio.h>
int main() {
int i;
double number, sum = 0.0;
for (i = 1; i <= 10; ++i) {
printf("Enter a n%d: ", i);
scanf("%lf", &number);
if (number < 0.0) {
continue;
}
sum += number; // sum = sum + number;
}
printf("Sum = %.2lf", sum);
return 0;
}

Program find the sum of all natural numbers between 1 to n. Input upper limit to find sum of natural numbers. Store it in some variable say N. Initialize another variable to store sum

C program code returns time in Coordinated Universal Time (UTC) (essentially Greenwich mean time). Printing the local time and date. Printing coordinated Universal Time and date

C Language Program calculates the Area of a Circle given it's Radius. Lets use The formula to compute the 'area' is: Area = ? x r2 where r is the radius of the circle & ? value is 22/7. 'Pi'

C Functions to find Diameter, Circumference and Area of circle. First assign a meaningful name to all the three functions. Say function to calculate diameter, circumference & area

C program print all natural numbers from 1 to n using loop. Input upper limit to print natural number from user. Store it in a variable say N. Run a For Loop from 1 to N with 1 increment.