چند تا برنامه ساده با کامپایلر gcc

چند تا برنامه ساده با کامپایلر gcc

نمایش اعداد ا تا ۵ روی صفحه ( حرف h را از آخر هر خط پاک کنید.)

hdzj@ubuntudes:~$ pico test.c

include <stdio.h>h#
void main(void)h
}
;int s
for(s=1;s<=5;s++)h
printf("%d\n",s);h
{

save and exit

hdzj@ubuntudes:~$ gcc test.c

hamed@ubuntudes:~$ ./a.out
-------------------------------------------------------------------------
لیست فایلهای / را نشان دهد. ( حرف h را از آخر هر خط پاک کنید.)

hdzj@ubuntudes:~$ pico test1.c

include <dirent.h>h#
include <stdio.h>h#

int main(voi)h
}
DIR *d;h
struct dirent *dir;h
d = opendir("/");
if (d)h
}
while ((dir = readdir(d)) != NULL)h
}
printf("%s\n", dir->d_name);h
{

closedir(d);h
{

return(0);h
{

hdzj@ubuntudes:~$ gcc test1.c

hamed@ubuntudes:~$ ./a.out