Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int vetor[10] = { 60, 50, 20, 40, 30, 80, 10, 90, 70, 100};
- int i, num;
- int encontrou = 0;
- printf("Informe um numero: ");
- scanf("%d", &num);
- ///// tá errado, tem q ser while
- enquanto i < 10 encontrou == 0
- for(i = 0; i < 10; i++){
- if(num == vetor[i]){
- encontrou = 1;
- break;
- }
- }
- if(encontrou == 1){
- printf("\nnumero encontrado\n");
- }else{
- printf("\nnumero não encontrado\n");
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement