اولا يجب ان نعرف قانون مساحه الدائره = 3.14 X نصف القطر X نصف القطر فلذلك سنعرف متغير لنصف القطر حيث يتم ادخال المتغير من قبل المستخدم ومتغير اخر لنخزن فيه قيمه المساحه.
;double A ;double area ;"cout << "please enter the radius of the circle ; cin>> A ; area =A*A*3.14 ;cout <<"the area of the circle is "<< area
لتقوم بكتابة برمجة حساب مساحة الدائرة ,ستحتاج إلى متغيرين , واحد لنصف القطر و سيشار إليه ب r و الآخر للمساحة وسيشار إليه ب area :;float area ,r ; "cout << "please enter the radius of the circle ; cin>>r ;area =r*r*3.14 ;cout <<"the circle's area for the radius that you have entered is "<< area