달력

102025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31



/* area.c */
/*
#include <stdio.h>
#define PI 3.141593

void main()
{
 int r = 5;
 float area;

 area = PI * r * r;

 printf("반지름이 %d인 원의 면적 : %d\n", area);
}
*/


 

/* praise.c 문자열 */
/*
#include <stdio.h>
#define PRAISE "What a super marvelous name!"
void main()
{
 char name[40];

 printf("실례지만 성함이 어떻게 되시는지?\n");
 scanf("%s", &name);

 printf("반갑습니다, %s 씨. %s\n", name, PRAISE);
}
*/



/*
#include <stdio.h>

void main()
{
 int a, b, sum;

 scanf("%d", &a); scanf("%d", &b);

 sum = a + b;

 printf("%d", sum);
}
*/



/* square.c */
/*
#include <stdio.h>

void main()
{
 int n, n2, n3;

 n = 5;
 n2 = n * n;
 n3 = n2 * n;
 printf("n : %d, n의 제곱 : %d, n의 세제곱 : %d\n", n, n2, n3);
}
*/




/*
#include <stdio.h>

void main()
{
 int width, height;

 scanf("%d", &width);
 scanf("%d", &height);
 printf("직사각형의 면적은 %d", width * height);
}
*/


 

/*
#include <stdio.h>

void main()
{
 int year;

 printf("몇 학년인가요?");
 scanf("%d", &year);

 printf("%d년에 졸업할 수 있겠군요", 2012+(4-year));
}
*/



/*
#include <stdio.h>

void main()
{
 int n;

 printf("정수를 입력하시오?\n");
 scanf("%d", &n);

 printf("%d의 제곱은 %d 입니다.",n,n*n);
}
*/



/*
#include <stdio.h>

void main()
{
 int dogs, cats;

 printf("개를 몇 마리나 키우십니까?\n");
 scanf("%d", &dogs);

 printf("고양이를 몇 마리나 키우십니까?\n");
 scanf("%d", &cats);

 printf("개와 고양이를 %d마리 키우신다구요!\n", dogs + cats);
}
*/



/*
#include <stdio.h>

void main()
{
 int dogs;

 printf("개를 몇 마리나 키우십니까?\n");
 scanf("%d", &dogs);
 printf("개를 %d마리 키우신다구요!\n",dogs);
}
*/



/*
#include <stdio.h>

void main()  // 간단한 프로그램
{
 int num; // num이라는 변수를 정의
 num = 1; // num에 값을 대입

 printf("나는 단순한 "); // printf() 함수
 printf("컴퓨터다.\n");
 printf("나는 최고이므로 %d를 좋아한다.\n",num);
}
*/


 

'매니저 > C' 카테고리의 다른 글

20120329 학교 내용  (0) 2012.03.29
C의 구성요소와 자료형  (0) 2012.03.25
02 입출력과 기본 프로그램  (0) 2012.03.24
학교 수업 내용 20120323  (0) 2012.03.23
20100320 학원  (0) 2012.03.20
Posted by cdprkr2077
|