S

@study2026

p93_1_20260619

C
1 week ago
#include <stdio.h> void main() { int a = 10; int b; int *c = &b; //c는 b의 주소를 가리키는 포인터 b = a++; //b=11 b += 10; //c=b=21 printf("a=%d\n", a); printf("b=%d\n", b);

p77_2_20260618

C
2 weeks ago
#include <stdio.h> int hap(int); void main(void) { int i, tot =0; for(i=0; i<3; i++) tot = tot+hap(i); // i=1 hap(5), 2번째 hap(11), 3번째 hap(17) tot=33 printf("%d\n", tot); } int hap(int i){ static int a[3][4]= {{1, 2, 3, 0}, {4, 5, 6

p77_1_20260618

C
2 weeks ago
#include <stdio.h> #define SIZE 20 int mapping(int); // 선언을 하고 맨아래 정의 void main(void) { int group[]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int loc[]={61, 127, 21}; int i; for(i=0; i<sizeof(loc)/sizeof(int); i++) printf("%d ", group[mapp

p78_3_20260617

C
2 weeks ago
#include <stdio.h> void printtest(int *p, int size); int main(int argc, char* argv[]) { int a[5] = {10, 20, 30, 40, 50}; int size = sizeof(a)/sizeof(a[0]); // size의 값은 5 printtest(a, size/2); //5/2는 정수로 반환하므로 2 return 0;

2011(14)

C
2 weeks ago
#define N 5 #include <stdio.h> typedef struct{ float x, r; } entry; void cal_row(entry (* a)[N], int j){ int i; for(i=0; i<N; i++){ a[j][i].r = a[j][i].x / a[j][j].x * 100;} } int main() {

p68_3_20260616

C
2 weeks ago
#include <stdio.h> void main() { int i, j, n=0; for (i=0; i<10; i++){ for (j=0; j<10; j++){ if (j>5) continue; //j=0~5까지만 가능 n++; } if(i>6) break; //조건이 누적후에 있어

p63_12_20260611

C
3 weeks ago
#include <stdio.h> int cal_first(void) { int k=0, p=0; do{ p=p+k; k++; }while (k<10); return p; }

p45_07_20260609

C
3 weeks ago
#include <stdio.h> int main(int argc, char *argv[]) { int a = 1, b, c, d; d= (b =a++, c=b+2); // 괄호 안의 내용은 오른쪽의 내용을 선택하여 d변수에 3이 저장 printf("a=%d, b=%d, c=%d, d=%d\n", a, b, c, d); return 0; }

p45_08_20260609

C
3 weeks ago
#include <stdio.h> void main() { int x=0x11; int y, z; y= x & 0x0f; //x=0001 0001 y=0000 1111을 &하면 결과는 0000 0001 저장 z= x | 0x0f; //x=0001 0001 y=0000 1111을 |하면 결과는 0001 1111 저장 printf("x=%d, y=%d, z=%d\n", x, y, z); //출력은 %d로

p44_6_20260608

C
3 weeks ago
#include <stdio.h> int main() { int a, b, c, r; a=4; b=2; c=3; r= a++ - ++b * (c<<2); // a=4 - ( b=3, c=1100(12)를 곱한 값 36) a와 계산한 최종값= -32 printf("%d\n", r);

p44_5_20260608

C
3 weeks ago
#include <stdio.h> unsigned int getbits(unsigned x, int p, int n) { return (x>>(p-n)) & ~(~0<<n); /* 312는 2진수 표현하면100111000을 오른쪽으로 4칸 시프트 연산을 해서 000010011 ~0은 0의 보수이므로 00000000을 11111111이고 이를 4칸 왼쪽 시프트하면 11110000이다. 그리고 괄호 밖의 ~으로

p54_1_20260610

C
3 weeks ago
#include <stdio.h> int main(){ int a=1, b=2, c=3, d=4; if((a==b)&&(c++ ==d)) c++; /* &&의 문제는 단락 회로 평가라고 하는데 왼쪽의 조건이 만족하지 않으면 오른쪽 조건은 실행하지 않고 종료된다.*/ printf("%d", c); }

43페이지 2번

C
4 weeks ago
#include<stdio.h> int f(int a){ return (a+1.5); } void main() { float x=3.5; int y=2; float z=1.0; z+= x+y*12.5+f(x);

43페이지 1번

C
4 weeks ago
#include<stdio.h> int main(){ int a; double c, d; c=a=3.5; d=3+a/2+c; printf("Result = %3.1f\n", d); return 0; }