4 Nisan 2016 Pazartesi

Power Function in C programming

/*
*       Math.h kütüphanesinde bulunan power fonksiyonunu kullanarak
*       bir sayının üssünün alınması. 0-1 arasındaki üs değerleri
*       denenmiştir.
*       That's the code that demonstrates power function that is
*       ready in math.h library header file. It calculates the power
*       of the number that is given.
*       Questo è il codice che dimostra la funzione forza che è
*       pronto in file di intestazione della libreria math.h. Si calcola
*       la potenza del numero che è dato.
*       sayı=number=numero
*       us=exponent(power)=esponente
*       sonuc=result=risultato
*    
*       Yazan/Writer : Msc. Koray Kara
*       Date : 04/04/2016
*
*/
/*It shows the result in integer.You can change it.
    This was just an experiment, not an obligation of course.
I am going to use that power function in another image
processing project , this is why i have tried if that works*/

/*Questo mostra il risultato in integer ma potete cambiare.
Era solo un esperienza, non é obligatorio certomente. Userò questa
funzione in un altra programma per elaborazione di immagini , allora ho
voluto provare se funziona cosi.*/

#include <stdio.h>
#include <conio.h>
#include <math.h>

int main(void)
{
double sayi;
double us;
double sonuc;
sayi=5;
us=0.5;
sonuc=pow(sayi,us);
printf("sonuc = %d\n",(int)sonuc);

us=0.9;
sonuc=pow(sayi,us);
printf("sonuc = %d\n",(int)sonuc);

getch();
return 0;
}



JAVA DIARY - 2

Class kodlarının içersinde ana fonksiyonumuzu public static void main olarak tanımlıyoruz. Parantezler içersinde görüldüğü gibi String[] ar...