Last active
October 3, 2017 20:14
-
-
Save mehmeteminkartal/c56cc9b5064348659682a267e3d99fff to your computer and use it in GitHub Desktop.
This file contains 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
// | |
// main.c | |
// Ödev 2 | |
// | |
// Created by Muhammet Mehmet Emin Kartal on 10/3/17. | |
// Copyright © 2017 Muhammet Mehmet Emin Kartal. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <math.h> | |
int main() { | |
// Küre yarı çapını tutacak değişkeni tanımla | |
double kureYariCapi; | |
// Kullanıcıya kürenin yarı çapını girmesi gerektiğini belirt | |
printf("Kürenin yarı çapını cm cinsinden girin\t\t: "); | |
// Kullanıcıdan gelen veriyi kureYariCapi değişkenine ata | |
scanf("%lf", &kureYariCapi); | |
// Kürenin yüzey alanını hespala | |
double yuzeyAlani = 4.0 * M_PI * pow(kureYariCapi, 2.0); | |
// Kürenin hacmini hesapla | |
double hacim = 4.0/3.0 * M_PI * pow(kureYariCapi, 3.0); | |
// Sonuçları ekrana yazdır | |
printf("yarı çapı %.2lf cm olan kürenin yüzey alanı\t: %.2lf cm2\n", kureYariCapi, yuzeyAlani); | |
printf("yarı çapı %.2lf cm olan kürenin hacmi\t\t: %.2lf cm3\n", kureYariCapi, hacim); | |
// Programı 0 koduyla sonlandır | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment