şeytan67 Posted May 9, 2013 Share Posted May 9, 2013 (edited) Klavyeden girilen bir sayının karesını fonksıyon kullanarak hesaplayan program C++ lazım arkadaşlar bana kod yazmasını bilen arkadaşlar yardımcı olabilirlermi benim fazla bilgim olmadığı için yazamıyorum Edited May 9, 2013 by şeytan67 Quote Link to comment Share on other sites More sharing options...
MostWanted Posted May 9, 2013 Share Posted May 9, 2013 Bu konu "Sohbet-Chat" forumundan "Yazılım" forumuna taşınmıştır. Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted May 9, 2013 Share Posted May 9, 2013 (edited) Aslında pow ile de yapılabilir ama sana iki şekilde de gösterelim. #include <iostream> #include <math.h> using namespace std; int kareAl(int y) { double sonuc; return sonuc = pow(y,2.0); } int main() { int sayi,sayinin_karesi; cout << "Bir sayi giriniz: " << endl; cin >> sayi; sayinin_karesi = kareAl(sayi); cout << "Sayinin karesi = " << sayinin_karesi << endl; return 0; } #include <iostream> using namespace std; int kareAl(int y) { return y*y; } int main() { int sayi,sayinin_karesi; cout << "Bir sayi giriniz: " << endl; cin >> sayi; sayinin_karesi = kareAl(sayi); cout << "Sayının karesi = " << sayinin_karesi << endl; return 0; } Edited May 9, 2013 by SimpsoN_Bart Quote Link to comment Share on other sites More sharing options...
şeytan67 Posted May 9, 2013 Author Share Posted May 9, 2013 teşekkür ederim kardesim pow'suz olan işimi görür pow'lu işlemedik çünkü çok teşekkürler Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted May 9, 2013 Share Posted May 9, 2013 Rica ederim, iyi geceler. Quote Link to comment Share on other sites More sharing options...
şeytan67 Posted May 9, 2013 Author Share Posted May 9, 2013 iyi geceler Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.