Skip to content

Instantly share code, notes, and snippets.

@huseyin
Last active August 29, 2015 14:16
Show Gist options
  • Save huseyin/332c7d6c1db893625ff8 to your computer and use it in GitHub Desktop.
Save huseyin/332c7d6c1db893625ff8 to your computer and use it in GitHub Desktop.
ilk c programı
/*
* OMU Bilgisayar Mühendisliği, Programlamaya Giriş II,
* 'C Programlama Diline Giriş' labaratuvar föy ödevi
* 2 sayısının üslerini rekürsif olmayacak şekilde almak.
*/
#include <stdio.h>
main(void) {
int x = 0, y;
double z = 2;
scanf("%d", &z);
printf("n \t 2^n\n--------------\n");
while (x <= y) {
if (x == 0)
z = 1;
printf("%d \t %f \n", x, z);
z = z * 2;
x++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment