-
#include <stdio.h> //표준 입력 / 출력 라이브러리
#include <math.h>
int main(void) // int : 함수의 반환 값으로 정수를 반환 -void : 함수의 입력으로 인수를 취하지 않는다
return 0;
printf("Input the value of x: ");
scanf_s("%d", &x);
printf("the value of x is : %d\n", x) \n 줄바끔
int - integer %d
float - float point number %f
char -a single character %c
선언 된 변수에만 값을 할당 . C는 대소 문자를 구분 (A1 a1 은 다른 변수)
+ addition - subtraction * multiplication / division % remainder = Asignment
c = c + 3 c += 3
++a a=5 5 6
a++ a=5 6 6
--b b=5 5 4
b-- b=5 4 4
if(x == 1) == != >= <=
else if
else
while (counter <= 10 ) // loop 10 times
while ( gread != -1 )
sum = sum
counter = counter + 1
printf( "%s", "Enter grade, -1 to end: ");
scanf_s("%d:, &grade);
for ( counter = 1; counter <=; ++counder )
for ( expressi on1; expressi on2; expressi on3 )
{
statement }
expressi on1;
while ( expressi on2 )
{ st at ement
expressi on3; }
counter = counter + 1
counter += 1
++counter
counter++
while ( condi t i on )
do
statement
while ( condi t i on );
while ( ( grade = getchar() ) != EOF )
&& (logical AND), || (logical OR) and ! (logical NOT )
댓글