Advertisement
Faice

goto

Dec 14th, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.     int s;
  5.    
  6.     printf("3을 곱하고 싶은 수를 써넣어라 : ");
  7.     scanf("%d", &s);
  8.    
  9.     int t;  //함수에 필요한 변수의 선언 int three(int t)와 같은 의미
  10.     goto three;
  11.     main:   //함수의 선언과 반환을 표현
  12.    
  13.     printf("3을 곱하니 %d가 나왔다\n", t);
  14.        
  15.     return 0;
  16.    
  17.     //three{
  18.         three:
  19.        
  20.         printf("3을 곱하고 있다\n");
  21.         t = s * 3;
  22.         goto main;  //함수의 반환
  23.     //}
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement