Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- int main (){
- float vet1[30];
- int i;
- for (i=0; i<30 ;i++){
- printf ("\nDigite 1 numero: ");
- scanf ("%f",&vet1[i]);
- }
- for (i=0; i<30 ;i++){
- if (i % 2 == 0){
- vet1[i] = vet1[i] * 1.02;
- }
- else{
- //impar
- vet1[i] = vet1[i] * 1.05;
- }
- }
- printf("\n\nVetor alterado:\n\n");
- for (i=0; i<30 ;i++){
- printf ("Vet1[%i] = %.2f \n", i, vet1[i]);
- }
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement