dolcemimi Posted June 11 Report Share Posted June 11 Well then how do you write it in script ??? SOMEONE HELP !!!! I'm confused and clueless !!! Quote Link to comment Share on other sites More sharing options...
trance604 Posted June 11 Report Share Posted June 11 Matt, its probably a CS assignment....im not much on programming in C, i can do well in Java and C++, but youll use, int to define a var, and printf to print...mod is the %, and youll have to define a main and compile. for more info, take a look at lecture slides 22 and on i think...this is from one of the cs courses i took last semester..hope it helps http://www.cc.gatech.edu/classes/AY2001/cs1322/slides/previous/spring2001/leahy/index.html ------------------------AIM:Turbo SC300------ Quote Link to comment Share on other sites More sharing options...
frenchbread Posted June 11 Report Share Posted June 11 here you go...but you should really try a little research next time... #include <stdio.h>int main(){ int result; float var1 = 1234.7893; result = 15 % 4; printf("modulus and printf quickie\n"); printf("\n15 %% 4 = %i\n", result); printf("0....5....0....5....0"); printf("\n%12.2f\n", var1); return 0;}------------------ AIM: thefrenchbreadYIM: thefrenchbread Quote Link to comment Share on other sites More sharing options...
flying_high Posted June 11 Report Share Posted June 11 Originally posted by frenchbread:here you go...but you should really try a little research next time... #include <stdio.h>int main(){ int result; float var1 = 1234.7893; result = 15 % 4; printf("modulus and printf quickie\n"); printf("\n15 %% 4 = %i\n", result); printf("0....5....0....5....0"); printf("\n%12.2f\n", var1); return 0;}lol...why did I just have the feeling, I would find you on that post...hahaha------------------ AIM: flying77highEmail:flying77high@yahoo.com Quote Link to comment Share on other sites More sharing options...
dolcemimi Posted June 12 Author Report Share Posted June 12 HELP ! How do you write a program that : prints and calculates 15%4 (modulus) using printf and before the printf create a variable callled result and store 15%4 intoresult, then display it using printf ALso I need to display the number .. 1234.7893 with 5 blank spaces and 2 digits after decimal. Quote Link to comment Share on other sites More sharing options...
matta Posted June 12 Report Share Posted June 12 not much of a programmer but why use C for this?This seems to be a fairly simple code that could be handled in a script... again, not a programmer but just thinking........Matt------------------ Stones Roses - Paint PromoAIM: mattarrundale1[This message has been edited by matta (edited 06-11-2001).] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.