power point

I wrote a little game where it picks a number, and you have to guess it, and I put together a single slide in power point with animations that says "you win!".
I need to put that at the en of an if statement saying that if x == y then it should play the slide, but ,of course, I don't know how to do that. you know what, heres the code;

#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
int x;
int y;

cout << "Guess The Number!" << endl;
cin>> x;
while (x != y)
{
y = rand()%(10) ;
cout << "wrong answer" << endl;
cin>> x;
}

if (x == y){
/* I try */ system("libraries\\stuff\\otherstuff\\you win!.ppt") /* but it can't find the path.*/
}
return 0;
}
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <cstdlib>
 using namespace std;
 
int main(){
int x,  y = rand()%(10);
 
cout << "Guess The Number between 1-10!" << endl;
cin>> x;
if(x != y)
	cout << "wrong answer" << endl;
else
	system("libraries\\stuff\\otherstuff\\you win!.ppt");
	return 0;
 }


first i fixed your code because there was a few flaws... as for not opening the power point i belive you cant just put the directory but have to also call on a command
Whatever you would type into a command prompt to make Powerpoint show a slide is what you have to pass to the system function.
Topic archived. No new replies allowed.