+ 3
How do i input number?
I tried to run the programme but output always 0 how do i input number here is the programme #include <iostream> using namespace std; int main() { float r, area; printf("enter the value of r"); scanf("%f",&r); area = 3.1416*r*r; printf("%.2f",area); }
3 ответов
+ 4
cout << "enter the value of r";
cin >> r;
+ 2
Include stdio.h library to the programme instead of iostream . Printf and scanf functions are available in stdio library not in iostream. For inputs and outputs there is cin and cout as above answers said.