Raised This Month: $51 Target: $400
 12% 

How to subtract 2 ints


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kasikadam
Member
Join Date: Jun 2016
Old 06-27-2017 , 18:07   How to subtract 2 ints
Reply With Quote #1

I may explain wrong but i want to subtract 2 ints and print as result.
How do i do this ? Thanks !
kasikadam is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 06-27-2017 , 18:13   Re: How to subtract 2 ints
Reply With Quote #2

PrintToChatAll( "5 - 3 is: %i", 5 - 3 );

or if you want to use variables

PrintToChatAll( "%i", int1 - int2 );
hmmmmm is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 06-28-2017 , 02:25   Re: How to subtract 2 ints
Reply With Quote #3

And to store the result in an int and print.

Code:
int a = 16;
int b = 12;
int result = a - b;
PrintToServer("a-b==%d", result);
__________________
Neuro Toxin is offline
sdz
Senior Member
Join Date: Feb 2012
Old 06-28-2017 , 06:38   Re: How to subtract 2 ints
Reply With Quote #4

I would suggest you give this a read before continuing on: Introduction to SourcePawn
sdz is offline
kasikadam
Member
Join Date: Jun 2016
Old 06-29-2017 , 05:31   Re: How to subtract 2 ints
Reply With Quote #5

Thank you all !
kasikadam is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode