GJPassos

VETORES 04

May 20th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1.  //GILMAR JUNIOR DOS PASSOS - PROF MALGARETE
  2.  //ALGORITMOS 02 CENTRO TECNOLOGICO UNIVERSIDADE POSITIVO
  3.  
  4.  #include <stdio.h>
  5.  #include <stdlib.h>
  6.  #include <math.h>
  7.  #include <iostream>
  8.  #include <conio.h>
  9.  #include <time.h>
  10.  #define XXX 5
  11.  
  12. //Faça um algoritmo que recebe 5 valores em R$ informados pelo usuário
  13. //e armazene-os em um vetor. Depois, leia esse vetor mostrando o valor
  14. //armazenado multiplicado por 2 (dois).
  15.  
  16. int main ()
  17. {
  18.     int valores[2][XXX], cont;
  19.     for (cont=0;cont<XXX;cont++)
  20.     {
  21.         printf ("Entre com um valor\n");
  22.         scanf("%d",valores[1][cont]);
  23.         valores[2][cont]=valores[1][cont]*2;
  24.         printf("O valor informado foi %d e sua multiplicação por 2 é: %d", valores[1][cont], valores[2][cont]);
  25.         }
  26.         getch();
  27.         }
Advertisement
Add Comment
Please, Sign In to add comment