Welcome, Visitor!

Hello, we are really happy that you have reached us. However, since you are viewing the forum as a visitor, you cannot benefit from many features of the forum. How about taking advantage of all the features exclusive to our members by registering? You can register right now, taking just 2 minutes of your time. We would love to see you among us.

C++ Hipotenüs Hesaplama

R

Rooster

only business
Thread Starter
Super Moderator
Joined
Aug 10, 2019
Messages
3,209
Reaction score
3,144
Points
113
Location
Milano
notlar.png

Bu yazımızda 2 dik kenarı girilen bir dik üçgenin 3. kenarını yani hipotenüsünü hesaplayan C++ Örneğini oluşturacağız. Öncelikle dik üçgende hipotenüs hesaplamak için aşağıdaki formülün kullanılması gerektiğini hatırlatalım.

c2=a2+b2
Math.h
kütüphanesini eklemeyi unutmamak gerektiğini de hatırlatarak C++ kodlarımıza geçelim.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 
#include <iostream>
#include <Math.h>
using namespace std;
main()
{
    setlocale(LC_ALL,"Turkish"); //Türkçe karakter
    float kenar1,kenar2,kenar3,sonuc;
    cout<<"Hipotenus Hesabi"<<endl;
    cout<<"---Realitycheats.com---"<<endl;
    cout<<"1.Kenar(a) = ";cin>>kenar1;   
    cout<<"2.Kenar(b) = ";cin>>kenar2;   
    kenar3=pow(kenar1,2)+pow(kenar2,2);
    sonuc=sqrt(kenar3);
    cout<<"Hipotenüs(c) = "<<sonuc;
}
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Theme editor

Top Bottom