블로그
-
투자노트 스터디 9주차 과제
반환할 자료형이 int 이고 입력은 int a, int b이며 처리할 내용은 int result = a+b 와 같이 두 수를 더해주는 프로그램을 짜고 return에 result를 주어 함수명은 임의로 지으시오. int plus(int a, int b) { int result = a+b; return result; } 나. int main() 내에서 int x=10
blog.naver.com · 2020.11.28
-
[예시] java 기본법 (10) Exception
ArrayIndexOfBoundException package Basic_STD; public class Main_Login { // 실행예외 (Runtime Exception) public static void main (String[] args) { // ArrayIndexOutOfBoundsException int[] score = new int[5]; score[5] = 99; } } ----
blog.naver.com · 2020.11.10
-
투자노트 스터디 과제 6주차
또한 아래 문항을 해결하시오. (0.5시간 소요) 가. int start를 선언하고 1을 주시오. 나. int end를 선언하고 10을 주시오. 라. for문의 종료조건에 i int main() { int start = 1; int end = 10; for (int i = start; i
blog.naver.com · 2020.11.08
-
[예시] java 기본법 (12) Exception
(String[] args) { // NumberFormatException String str1 = "200"; String str2 = "200A"; int a = Integer.parseInt (str1); int b = Integer.parseInt(str2); } } 결과 Exception in thread "main" java.lang.NumberFormatException
blog.naver.com · 2020.11.10
-
투자노트 스터디 5주차 과제
#include int main() { int a = 1; return 0; } 다. int형 변수 b를 선언하여 2를 넣으시오. #include int main() { int a = 1; int b = 2; return 0; } 라. a=1이라면 "1이 들어있습니다."를 출력하는 프로그램을 작성하시오.
blog.naver.com · 2020.11.01
-
투자노트 스터디 과제 7주차
#include int main() { int a = 100; int d = -3; int n = n; int A; printf("원하는 n값을 넣으세요: \n"); scanf_s
blog.naver.com · 2020.11.16
-
[예시] java 기본법 (9)
package Basic_STD; public class Main_Ex3 { public static void main(String[] args) { /* * 암시적 형 변환 */ )100.0; int b1 = (int)100.0F; System.out.printf("%f, %s", a1, b1); } }
blog.naver.com · 2020.11.03
-
[예시] java 기본법 (13) Exception
ArithmeticException package Basic_STD; public class Main_Login { // 실행예외 (Runtime Exception) public static void main (String[] args) { // ArithmeticException int result = 20/0; System.out.println(result); } } 결과 Exception
blog.naver.com · 2020.11.10
-
투자노트 스터디 4주차 과제
증감연산자가 무엇인지 찾아보고 x의 초기값이 1일때의 사용 예시를 적고 결과값을 printf해 보시오. (0.5시간 소요) 가. x++ : #include int main() { int x = 1; x = x++; printf("%d\n", x) return 0; } 나. x-- : #include int main() { int x = 1; x = x--;
blog.naver.com · 2020.10.25
-
[예시] java 기본법 (5)
public class Main_Ex1 { public static void main(String[] args) { // ARRAY int[] score = {10, 20, 30, 40, 50}; // 5개의 배열 초기화 // int[] score = new int[5]; // 5개의 배열 초기화 int count = score.length; // length값
blog.naver.com · 2020.10.25