initial import
[staff/goc4/2018bti7061.git] / c-2-controlStructures / examples / controlStatements / continue.c
1 #include <stdio.h>
2 #include <math.h>
3 main(){
4 puts("--------------------------");
5 puts("Examples with CONTINUE");
6
7 long int i,val;
8
9 for(i=0; i< 10; i++){
10 puts("Type a number:");
11 scanf("%ld",&val);
12 if(val<0){ /* A negative number does not have a sqrt*/
13 printf("Negative number do not have any real square root\n");
14 continue;
15 }
16 double res = sqrt(val*1.0);
17 printf("Square root of %ld is %lg\n",val,res);
18
19 }
20
21
22 }