Last active
December 27, 2015 11:39
-
-
Save seyyah/7319635 to your computer and use it in GitHub Desktop.
Harita Mühendisliği Bölümü Görsel Programlama Dersi, 2013-2014 Güz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - max | |
| - mutlak | |
| - BMI | |
| - Hal (katı, sıvı, gaz) | |
| - Ortalama: geçti, kaldı |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clc; | |
| for i=1:10 | |
| i | |
| end | |
| clc; | |
| for i=1:10 | |
| disp(i); | |
| end | |
| clc; | |
| for i=1:10 | |
| fprintf('%d ', i); | |
| end | |
| clc; | |
| for i=1:2:10 | |
| fprintf('%d ', i); | |
| end | |
| clc; | |
| for i=2:2:10 | |
| fprintf('%d ', i); | |
| end | |
| clc; | |
| for i=10:-1:1 | |
| fprintf('%d ', i); | |
| end | |
| clc; | |
| t = 0; | |
| for i=1:10 | |
| t = t + i; | |
| end | |
| disp(t); | |
| clc; | |
| t = 0; | |
| for i=1:2:10 | |
| t = t + i; | |
| end | |
| disp(t); | |
| clc; | |
| d = [2 3 11 7 8 19 23]; | |
| for i=1:7 | |
| fprintf('%d ', d(i)); | |
| end | |
| clc; | |
| d = [2 3 11 7 8 19 23]; | |
| t = 0; | |
| for i=1:7 | |
| t = t + d(i); | |
| end | |
| disp(t); | |
| clc; | |
| d = [2 3 11 7 8 19 23 99 67]; | |
| for i=1:length(d) | |
| fprintf('%d ', d(i)); | |
| end | |
| clc; | |
| d = [2 3 11 7 8 19 23 99 67]; | |
| for i=1:length(d) | |
| if mod(d(i), 2) == 1 | |
| fprintf('%d ', d(i)); | |
| end | |
| end | |
| clc; | |
| d = [2 3 11 7 8 19 23 99 67]; | |
| for i=1:length(d) | |
| if mod(d(i), 2) == 1 | |
| fprintf('%d ', d(i)); | |
| else | |
| fprintf('* '); | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clc; | |
| disp('Ikinci dereceden....'); | |
| a = input('x^2 katsayi: '); | |
| b = input('x^1 katsayi: '); | |
| c = input('x^0 katsayi: '); | |
| delta = b^2 - 4*a*c; | |
| if delta < 0 | |
| disp('Gercel kok yok!'); | |
| else | |
| x1 = (-b + sqrt(delta)) / (2*a) | |
| x2 = (-b - sqrt(delta)) / (2*a) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment