+ 2
What is the mistake ? Specific in the second line
#include <iostream> #include <conio> using namespace std; int main() { int x ,y ,sum; cout<< "enter value x"; cin>> x; cout<<"enter value y"; cin>> y; sum=x+y; cout<<"the sum =" <<sum; getch(); return 0; }
7 Réponses
+ 4
Then enter the input like this:
10
20
Then you see the output
+ 3
Don't use:
getch() and #include<conio>
+ 3
@Sakshi,
Can you please give a bit more information why we should not use getch() and #include<conio> ? Thanks!
+ 2
Basma ,
Since as in Turbo C++ IDE only we use this format of including #include<conio.h>...which is older one...
In modern compilers there is no need for it ...
+ 1
Victoria Mostova ,
thanks for your helpful information concerning the use of <conio.h>. now i understand.