switch

제어문조건문if, switch ~ case반복문for, while, do ~ while분기문break, continue, goto, return 이중에서 조건문에 종류들에 대해서 알아보자조건문은 크게 if문과 switch~case문으로 나눠진다. if문조건이 참일때만 고려#include int main() { int number = 5; if (number > 3) { printf("number는 3보다 큽니다.\n"); } return 0;} if ~else 문조건을 연속으로 확인#include int main() { int number = 2; if (number > 3) { printf("number는 3보다 큽니다.\n"); } els..
변수와 리터럴 int i=1; 정수 타입 변수 i를 선언함과 동시에 1로 초기화 int : 정수 타입(type)을 나타내는 키워드 키워드란 java언어에서 정한 예약어를 말한다. class, public, static, while 모두 키워드 i : 변수 i, 하나의 값을 가질 수 있는 공간 1: 정수 리터럴 1. 리터럴이란 변수에 입력되는 값 기본형 타입 : 소문자로 시작, 메모리 안에 값 저장 정수타입(byte) : short(2), int(4), long(8) 실수타입 : float, double 문자 1개 : char boolean : 참(true) or 거짓(false) 참조형(reference)=기본형이 아닌 타입(대문자로 시작): class, interface,배열 등.. 값을 참조 변수명 ..
계란소년
'switch' 태그의 글 목록