C++ Questions Answers-C++ basic syntax(PartII)


C++ basic syntax(PartII)

1. Find any errors in the following C++ program:
#include<iostream>
using namespace std;
void main(){ /* This is the main function
  cout<<'C++ Programming questions and answers';

}
Check answer 2. Find any errors in the following C++ program:
#include<iostream>
using namespace std;
void main(){ // This is the main function
  integer a;
  float b;

}
Check answer 3. Find any errors in the following C++ program:
#include<iostream>
using namespace std;
int main(){ // This is another C++ program with some errors
  a,b,s int;
  d float;
  cout<<"The end of the program";
  return 0;
}
Check answer 4. What is the output from the following C++ program?
#include<iostream>
using namespace std;
int main(){ // This is another C++ program with some errors
  int a,b,sum,subtr;
  a=100;
  b=20;
  sum=a+b;
  subtr=a-b;
  cout<<left;
  cout<<setw(5)<<"a+b"<<setw(5)<<"a-b";
  cout<<setw(5)<<sum<<setw(5)<<subtr;
 }
Check answer


Comments

JAMES REID YJ SOON MARK MY WOR comment

 JAMES REID YJ SOON MARK MY WOR

@Rana Mehroz, oh? so it is just for you. :))))


2017-10-18
Rana Mehroz comment

 Rana Mehroz

hahahhahhahahahaha... Its only for kids


2017-08-29
lusavya comment

 lusavya

thanks so much


2017-02-12



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.