Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Untitled Prezi

No description
by

junyeong BAEK

on 27 February 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Untitled Prezi

for 문 if문의 문법 switch 문 반복문 같은 처리 과정을 되풀이 하는것이 필요하기 때문이다. while 문 while(조건식)
문장; for(초기화; 조건; 증감)
{
반복하고자 하는 문장
} Last Day C Language if - else 문 if ( 조건문 )
{
실행문1;
} if ( 조건문 )
{
실행문1;
}
else
{
실행문2;
} 실습예제 #include <stdio.h>

int main()

{

int Num;

printf("1~5까지 숫자 입력 : ");
scanf("%d",&Num);

if(Num < 1 || Num > 5 ) //단일 if문
{
printf("입력범위를 벗어났습니다.");
}

if(Num == 1) //조건이 참일 때
{
printf("당신이 입력한 수는 1 입니다.");
}
else //조건이 거짓일 때
{
printf("당신이 입력한 수는 1이 아닙니다.");
}

return 0;

} 다중 if문의 문법 if(조건식1)
문장1;
else if(조건식2)
문장2
else if(조건식3)
문장3;
else
문장4; 실습예제 #include <stdio.h>
int main(void)
{
        int score;
        printf("성적을 입력하시오: ");
        scanf("%d", &score);
        if (score >= 90)
                printf("합격: 학점A\n");
        else if (score >= 80)
                printf("합격: 학점B\n");
        else if (score >= 70)
                printf("합격: 학점C\n");
        else if (score >= 60)
                printf("합격: 학점D\n");
        else
                printf("불합격: 학점F\n");
       return 0;
} switch(조건식)
{
case c1:
문장1;
break;
case c2:
문장2;
break
default:
문장
break;
} 실습예제 int main(void)
{
  int number;

 printf("정수를 입력하시오:");
        scanf("%d", &number);
       
  switch(number)
        {
                case 0:
                        printf("없음\n");
                        break ;
                case 1:
                        printf("하나\n");
                        break ;
                case 2:
                        printf("둘\n");
                default:
                        printf("많음\n");
                        break;
        }
} switch 문과 if-else 문 실습예제 #include <stdio.h>

int main(void)
{
        int meter;
        int i = 0;
        
        while(i < 3)
        {
                meter = i * 1609;
                printf("%d 마일은 %d 미터입니다\n", i, meter);
                i++;
        }

        return 0;
} 반복 조건 반복 내용 실습예제 #include <stdio.h>

int main(void)
{
        int i, n;

        printf("정수를 입력하시요:");
        scanf("%d", &n);

        printf("====================\n");
        printf("   i       i의 세제곱\n");
        printf("====================\n");
        for(i = 1;i <= n; i++)
                printf("%d     %d\n", i, i*i*i); 

        return 0;
} 중첩 for문 실습예제 #include <stdio.h>

int main(void)
{
        int x, y;

        for(y = 0;y < 5; y++)
        {
                for(x = 0;x < 10; x++)
                        printf("*");
                printf("\n");
        }
        return 0;
} *
**
***
****
*****
Full transcript