Will anyone explain why this programm not showing correct output on turbo c ide on pc?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Will anyone explain why this programm not showing correct output on turbo c ide on pc??

https://code.sololearn.com/cHoW3y1ua4Er/?ref=app

2nd Nov 2020, 4:12 PM
Kajal Kumari
5 Answers
+ 16
Plz stop using turbo c/c++ it's too old. https://www.sololearn.com/Discuss/288609/?ref=app
2nd Nov 2020, 6:26 PM
Aakaanksha 💕 [TheBraveCoders]
Aakaanksha 💕 [TheBraveCoders] - avatar
+ 2
Does it show correct output in another compiler? if not, then check the code for flaws.
2nd Nov 2020, 4:53 PM
Ipang
+ 2
Thank u soo much
3rd Nov 2020, 1:51 AM
Kajal Kumari
+ 2
Because turbo C is a 30 year old compiler that died before you were born. (I assume you're under 20)
3rd Nov 2020, 3:56 PM
Aria
Aria - avatar
+ 2
#include <iostream> using namespace std; #include <fstream> #include <stdio.h> #include <string.h> int main() { char name[10]; int roll; ofstream out; ifstream in; out.open("student"); cout<<"enter your name"; cin>>name; cout<<"\nenter your roll"; cin>>roll; out<<name<<endl; out<<roll<<endl; out.close(); roll=0; strcpy(name,"noname"); in.open("student"); in>>roll; in>>name; cout<<"\nyour roll is "<<roll<<endl; cout<<"\nyour name is "<<name<<endl; in.close(); }
29th Nov 2020, 7:26 AM
A S Raghuvanshi
A S Raghuvanshi - avatar