Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help would be desired!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Coldie ;]
Guest





PostPosted: Fri Feb 12, 2016 12:54 am    Post subject: Help would be desired! Reply with quote

I've decided to teach myself how to code, despite disliking it.. and sucking at it.

I'm just following an online text book, I'm curious why this is not staying open when I compile it. I know I'm missing a line of code somewhere, just unsure where.

Code:
#include <stdio.h>

int main () {

  int n = 0;
  int s = n * n;
  int c = n * n * n;
  int t = n + s + c;

  printf("n s c t\n");

  while ( n <= 100 ) {
    s = n * n; //square
    c = (n * n) * n; // cube
    t = n + s + c; // sum of all
    printf("%d %d %d %d\n", n, s, c, t);
    n++;
  }

  return 0;

}




edit: I'm an idiot, I forgot scanf.

Leaving it here to show disgrace to my family.

edit2:

Actually the correct answer was..

cin.get();



I've got a long way to go.

edit3:

Actually the problem was with the compiler I was using.
Back to top
deleted19776
I post too much
Reputation: 11

Joined: 29 Apr 2007
Posts: 3838

PostPosted: Fri Feb 12, 2016 7:06 am    Post subject: Reply with quote

Well, glad you found out your problem.
Back to top
View user's profile Send private message
AverageAzn247
Grandmaster Cheater
Reputation: 34

Joined: 01 Oct 2007
Posts: 909
Location: Austin,TX with 72 virgins

PostPosted: Fri Feb 12, 2016 7:03 pm    Post subject: Reply with quote

what kind of book are you using? I have never seen a while loop written like that most while loops r written
Code:
while (initialize var; how long the var runs till; and var ++)

_________________


Waxxup wrote:
What are Night Elves?
A girl group?
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites