#include<stdio.h> int main() { int i,n; double R,V,H; double volume(double R,double H); printf("Enter n:"); scanf("%d",&n); for(i=1;i<=n;i++){ printf("Enter R and H: "); scanf("%lf%lf",&R,&H); if((R<=0)||(H<=0)) { printf("Enter wrong!"); } else{ V=volume(R,H); printf("V=%.3f ",V); } } return 0; } double volume(double R,double H) { double result; result=3.14*R*R*H; return result; }