E D R , A S I H C RSS

간단한C언어문제

가 내는 C.
C를 *대로* 배다면 가 될 것다.
** : 말고 그냥 보기 바란다.


~cpp 
Spec과 같다.
16Bit  Windows
ANSI C를 규격는 Compiler (C90)

※ 다 다면 다고 고, 다고 그런 .

1.
~cpp 
#include <stdio.h>

main(){
int i;

	for(i=0; i<10; i++){	// 딴 : {는 for문 뒤 는 것 다. -_-. 내리는 것   다.(가독 다.)
		printf("%d", i);
	}
}
Note:
-
다. -_- -

다. 메 못되다. -yahar

다. -

C 따라 메렇게 ;;; 러는 return int 라고 warnning 내기 ;; -
로그래밍 다. C90라는 . 로그래밍 다고 더라, 로그램 따라 로그래밍 는게 다.
, 그렇 다. -yuhar
-

2.
~cpp 
#include <stdio.h>

main(){
int a, b;
double c;

	a = 30000;
	b = 30000;

	c = a + b;

	printf("%f", c);
}
Note:
-
다. 는 %f 가 %d로 바뀌면 더 력될꺼같다.-
signed int a b를 더면 (65535/2)게 되 -가 나다. (-65536/2)+((30000+30000)-(65536/2-1)) <- 제대로 설명을 못하겠다;;; -
-

3.
~cpp 
#include <stdio.h>

main(){
const char *a;
char *b, msg[]="test code";

	a = msg;
	b = a;

	puts(msg);
	puts(msg);
}
Note:
-
다. 그러까 &a 값만 변 같다(닌가;;)-
다. 문 b=a; 다. const char * char * 다. 러. -
-

4.
~cpp 
//  대로  되며,  된다.
#include <stdio.h>

main(){
float num;
char data[]="123.12";

	num = atof(data);

	printf("%f", num);
}
Note:
-
다. f가 고 s다. -
다. atof로 float변만, atof 더를 기 때문 int로 return된다. , num 123 담긴다. ANSI C99 록 변다. -
-

5.
~cpp 
main(){
int a, b, c;

	a = 0010;
	b = 0200;
	c = 2000;

	printf("a=%d b=%d c=%dn", a, b, c);
}
Note:
-
다. 0 되는같다. -
다. 0 면 8급된다. 0x <- 16진수 -
-

6.
~cpp 
#include <stdio.h>
#include <ctype.h>

main(){
char ss[] = "A2 문";
int i;

	puts(ss);

	for(i=0; ss[i]; i++){
		printf("i=%d %4x(%4d) ", i, ss[i], ss[i]);
		if(isdigit(ss[i]))	puts("");
		else			puts("반 문");
	}
}
Note:
-
다. ss[] "문"란 단는 isdigit로 다. (므로.) isdigit로 려면 unsigned char 면 된다. 기본 char signed다. -
-

7.
~cpp 
#include <stdio.h>

main(){
int i;

	while(scanf("%d", &i), i)
		printf("%d", i);
}
Note:
-
다. 같다. -
다. , 교문 다. -
-

8.
~cpp 
#include <stdio.h>

main(){
char *p;

	gets(p);
	puts(p);
}
Note:
-
다. 단 다. -
다. 다. -
-

9.
~cpp 
// main.h
#define NUM 100

struct a {
	int num1;
	int num2;
};

// main.c
#include "main.h"
#define NUM 200

main(){
struct a test;

	test.num1 = 100;
	test.num2 = 200;

	printf("%d", test.num1+test.num2);
}
Note:
-
다. -
다. NUM 가 2 define 되다. define된 200리된다. -
-

10.
~cpp 
// 두  linking
//main1.c
static int a = 100;

int mul(int num)
{
	printf("a = %d", a);
	return num*num;
}

//main2.c
main(){
exturn int a;

	printf("a = %d");
	printf("%d", mul(100));
}
Note:
-
다. -
다. static C++ private 다. 다는 것 다. -
-

11.
~cpp 
// 두  linking
// 1.c
main(){
double a, b;

	a = 1234.1234;
	b = 123.123;

	printf("%f", mul(a, b));
}

// 2.c
double mul(double a, double b){
	return a*b;
}
Note:
-
다. -
다. 기 때문 return int로 바뀐다. return 는 것다. -
-

12.
~cpp 
main(){

Note:
-
-

100만 내겠다. -_-
11 .

무나 되는 ? --
무나 되는. --
. ^^ 근데 각보다 문득 각나ㅋㅋ --
. . --

가독 따로 뽑 가독 다. 견 교 로 만들 다 -

;; -

----

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:38
Processing time 0.0209 sec