Computer Science, asked by sangeetasatija9, 6 months ago

Q. Find Out The Errors And Re-write The Program Again Without Errors :

(i) # include < iostream.h>;
void main { }
{
cout < < "welcome to C++" ;
}

(ii) # include <math.h>
main ( )
{
cin > > a;
}
​​

Answers

Answered by vijayghore
3

Answer:

#1.

#include <iostream>

using namespace std;

void main()

{

     cout<<"Welcome to C++";

}

#2.

#include<iostream>

#include<math.h>

using namespace std;

void main()

{

     int a;

     cin>>a;

}

Answered by anindyaadhikari13
2

Question:-

Find the errors in the following code.

Solution:-

Question 1.

# include < iostream.h>;

void main { }

{

cout < < "welcome to C++" ;

}

errors are marked as bold,

after correction,

# include < iostream.h>;

using namespace std;

void main()

{

cout < < "welcome to C++" ;

}

Question 2.

# include <math.h>

main ( )

{

cin > > a;

}

After correction,

#include <iostream>

#include <math.h>

using namespace std;

void main()

{

int a;

cin >>a;

}

Similar questions