when i use cout or cin call & then either << or >> .....it shows
declaration syntax error...what should i do?
cout<<"anything";
int a;
cin>>a;
return 0;

Answers were Sorted based on User's Feedback



when i use cout or cin call & then either << or >> .....it shows declaration synta..

Answer / nilam

If you are using Turbo C complier need to add #include<iostream.h> header file.

and If you are using Visual Studio then you need to add

#include<iostream>
using std namespace;

the above two statements.

Is This Answer Correct ?    0 Yes 0 No

when i use cout or cin call & then either << or >> .....it shows declaration synta..

Answer / ramchandranaik

if you are using Turbo C complier need to add #include<iostream.h>
header file.
or if ur using dev C++ then

#include<iostream>
using namespace std;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C C++ Errors Interview Questions

I'm having trouble with coming up with the correct code. Thank You!! The assignment was to write a program using string functions that accepts a price of an item and displays its coded value. The base of the keys: X C O M P U T E R S 0 1 2 3 4 5 6 7 8 9 Sample I/O Dialogue: Enter Price: 489.50 Coded Value: PRS.UX

0 Answers  


what are the techniques for reducing the fragility of a memory bug?

1 Answers  


Why are memory errors hard to debug?

1 Answers  


char* f() return "hello:"; void main() {char *str=f(); }

1 Answers  


Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?

2 Answers  






what is exceptions?

5 Answers   HCL, Wipro,


what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }

4 Answers  


What are the different types of errors in C and when they occur?

4 Answers  


Using string functions write a program that will accept the name of the capital as input value and will display the corresponding country. ------------------------ Capitals Countries ------------------------ Capitals Countries Ottawa Canada Moscow Russia Rome Italy I can't not get it to run properly

1 Answers   AMA,


which typw of errors ? & how to solve it ?

0 Answers  


printy(a=3,a=2)

3 Answers  


void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?

24 Answers   HCL,


Categories