Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobierenF&A Diskussionen
can someone please explain why this code keeps telling me complication error instead of outputting the value of speed.
#include <iostream>
using namespace std;
class myClass {
public:
void setcarspeed (int a){
speed=a;
}
int getcarspeed(){
return speed;
}
private:
int speed;
};
int main() {
myClass obj;
obj.setcarspeed (40);
cout<<obj.getcarspeed ;
return 0;
}
2 Stimmen
3 AntwortenWhat ever I learned here most of the things are not working in turbo c++ ? i.e . instead of iostrem I have to write iostream. h . why is this so?? also it is not accepting this- using namespace std;
. and also not accepting return 0; . Please help me iam really confused. Thanks :)
0 Stimmen
5 Antwortenin order to find the sum of n numbers given by user,suppose our program is to find the sum of any 4 numbers given by user (using while loop such that (while(i<=4))and incrementing each value of i by 1),if the user give any 2 inputs instead of four then the total sum should be the summation of that two inputs..but the program shows the sum something else,why it is so??
2 Stimmen
3 AntwortenRetrieve lost work and XP
0 Stimmen
1 AntwortHeute heiß
How to remember what you learned
2 Votes
Find saved code
1 Votes
Usage of Carriage Return (`\r')
3 Votes
How to build logic?
0 Votes
I want a little help.
0 Votes
What is the output of this code?
0 Votes
Question: about node.js
1 Votes