08.11.2014 Views

c_kitap

c_kitap

c_kitap

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C ve Sistem Programcıları Derneği - C Ders Notları - Necati Ergin<br />

#include <br />

int isprime(int val);<br />

int main(int argc, char *argv[])<br />

{<br />

int lower_bound, upper_bound;<br />

int k, temp;<br />

int prime_counter = 0;<br />

FILE *f;<br />

if (argc != 4) {<br />

printf(" \n");<br />

exit(EXIT_FAILURE);<br />

}<br />

lower_bound = atoi(argv[1]);<br />

upper_bound = atoi(argv[2]);<br />

if (lower_bound > upper_bound) {<br />

temp = lower_bound;<br />

lower_bound = upper_bound;<br />

upper_bound = temp;<br />

}<br />

f = fopen(argv[3], "wb");<br />

if (f == NULL) {<br />

printf("%s dosyasi yaratilamiyor!\n", argv[3]);<br />

exit(EXIT_FAILURE);<br />

}<br />

printf("%s dosyasi yaratildi!\n", argv[3]);<br />

for (k = lower_bound; k

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!