Advertisement
DAnIvDb

Untitled

Jan 24th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void main(){
  4. system("color 0A");
  5. int bidi[3][4]={{3,4,5,4},{1,2,3,4},{7,8,6,4}};
  6. int pos1=0;
  7. int pos2=0;
  8. int i=0;
  9. int j=0;
  10. printf("Introduce el primer numero de la posicion:");
  11. scanf("%d",&pos1);
  12. printf("\nIntroduce el segundo numero de la posicion:");
  13. scanf("%d",&pos2);
  14. if(pos1<3&&pos2<4&&pos1>=0&&pos2>=0){
  15. printf("\nViejo array:");
  16. for(i=0;i<3;i++){
  17. for(j=0;j<4;j++){
  18. printf(" %d",bidi[i][j]);
  19. }
  20. }
  21. printf("\nCambia el numero:");
  22. scanf("%d",&bidi[pos1][pos2]);
  23. printf("\nNuevo array:");
  24. for(i=0;i<3;i++){
  25. for(j=0;j<4;j++){
  26. printf(" %d",bidi[i][j]);
  27. }
  28. }
  29. }else{
  30. printf("ERROR");
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement