-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhile.c
57 lines (42 loc) · 994 Bytes
/
while.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <stdio.h>
int main(){
printf("Escreva o valor do raio:");
int n;
scanf ("%d", &n);
for (int i =0; i<=n; i++){
int res = n*i ;
printf("%d x %d = %d\n", n, i, res);
}
int i = 0
while (i<=50){
int res = n*i ;
printf("%d x %d = %d\n", n, i, res);
i++;
}
int soma = 1;
for (i =0; i<=n; i++){
printf("2^%d=%d\n", i, soma);
soma = soma*2;
return 0;
}
for (i=1; i<=n; i++){
fat = fat*i;
}
printf("%d^%d=%d\n", n, i, fat);
char text[80];
char pav[80];
int i, j, tamt, tamp;
printf("texto=\n");
fgets(text,80,stdin);
printf("palavra=\n");
fgets(pav,80,stdin);
tamt = strlen(text)-1;
tamp = strlen(pav)-1;
printf("A palavra esta nas posições\n");
for(i=0;i<=tamt-tamp;i++){
j=0;
while(j<tamp){
if(pav[j]!=text[i+j]) break;
j++;
}
if(j==tamp) printf("%d\n", i);