Write a language program to get the volume of a sphere with radius 6

  • برمجة سي بلس بلس
  • برمجة

Write a language program to get the volume of a sphere with radius 6

Sample Output:

Calculate the volume of a sphere :                                    
---------------------------------------                                
 Input the radius of a sphere : 5                                      
 The volume of a sphere is : 523.333

الأجوبة

#include <iostream>
using namespace std;

    int main()
    {
    	int rad1;
    	float volsp;
		cout << "\n\n Calculate the volume of a sphere :\n";
		cout << "---------------------------------------\n";		
        cout<<" Input the radius of a sphere : ";
    	cin>>rad1;
    	volsp=(4*3.14*rad1*rad1*rad1)/3;
        cout<<" The volume of a sphere is : "<< volsp << endl;
        cout << endl;
        return 0;
    }
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...