Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Escreva um procedimento em linguagem C chamado TrocaInt que troca os valores de
- duas variáveis inteiras X e Y. */
- #include <stdio.h>
- #include <stdlib.h>
- void TrocaInt(int x, int y);
- void main(){
- int x, y;
- printf("Digite x e y e trocarei eles de lugar\n");
- printf("x: ");
- scanf("%d",&x);
- printf("y: ");
- scanf("%d",&y);
- TrocaInt(x,y);
- system("Pause");
- }
- void TrocaInt(int x, int y){
- int aux;
- aux=x;
- x=y;
- y=aux;
- printf("\nx: %d\ny: %d",x,y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement