MENU
Question -

Observe the following C++ code carefully and write the same after removing syntax errors.

#define change(A,B)2*A+B;
void main()
{
float X,Y,F; 
cin>>X>>Y;
F=Change(X,Y);



Answer -

The corrected code is :

#define change(A,B)2*A B; 
void main()
{
float X,Y,F; 
cin>>X>>Y;
F=change(X,Y);  
cout<<"result:<
}

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
×