Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IFF - Introdução à Programação
- //Lista - Exercício 80
- #include<stdio.h>
- #include<locale.h>
- int main(){
- setlocale(LC_ALL,"Portuguese");
- int vetorColuna1[7]={0}, vetorColuna2[7]={0}, matriz[7][2],check=0;
- for(int i=0;i<7;i++){
- if(check==0){
- printf("Entre com o valor da posição %d do primeiro vetor: ",i+1);
- scanf("%d",&vetorColuna1[i]);
- matriz[i][0]=vetorColuna1[i];
- }
- if((check==0)&&(i==6)){
- check=1;
- i=0;
- }
- if(check==1){
- printf("Entre com o valor da posição %d do segundo vetor: ",i+1);
- scanf("%d",&vetorColuna2[i]);
- matriz[i][1]=vetorColuna2[i];
- }
- }
- printf("\n\nMatriz resultado:\n");
- for(int l=0;l<7;l++){
- for(int c=0;c<2;c++){
- printf("%d ",matriz[l][c]);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment