How to start from beginning of the program

前端 未结 6 1735
灰色年华
灰色年华 2021-01-17 02:00

I am a very beginner in c++. i am just learning abc of this language.. i created this small program that would add:

#include 
   using namesp         


        
6条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 02:11

    Just call main(); again.. in your code will be like this:

    #include 
    using namespace std;
    
    float add(float a, float b){
                  return a+b;  
          }
    
    int main(){
    
        float num1;
        float num2;    
    
        cout<<"add...enter digits \n";
        cout<<"first digit: ";
        cin>>num1;
        cout<<"\n Second number: ";
        cin>>num2;
    
        cout<< "your sum is: "<

提交回复
热议问题