Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

i need help please help me..

rentaw02rentaw02 Member Posts: 7
[b]i need [color=Red]help[/color] i need to make 3 different kinds of programs[/b] at turbo c [u]using arithmetic operations, logical...If statement, else if..., back ground color and text color[/u]..if you have programs with those,could please tell me the codes..[color=Red]please please please help me[/color]...[b][italic][u][color=Blue]thank yo[/color]u[/u][/italic][/b]

Comments

  • Malcolm_McLeanMalcolm_McLean Member Posts: 254 ✭✭
    : [b]i need [color=Red]help[/color] i need to make 3 different kinds
    : of programs[/b] at turbo c [u]using arithmetic operations,
    : logical...If statement, else if..., back ground color and text
    : color[/u]..if you have programs with those,could please tell me the
    : codes..[color=Red]please please please help
    : me[/color]...[b][italic][u][color=Blue]thank
    : yo[/color]u[/u][/italic][/b]
    :
    [code]
    /* arithmetical operation */
    #include

    int main(int argc, char **argv)
    {
    int sum;

    /* argument 1, argv[0] is program name,
    arguments 2 and 3 (argv[1], argv[2]) should be numbers typed
    on the commandline */
    if(argc != 3)
    printf("Call with two numbers
    ");
    else
    {
    /* atoi converts from strings to integers */
    sum = atoi(argv[1]) + atoi(argv[2]);
    printf("sum is %d
    ", sum);
    }
    }
    [/code]

    Modify this to print out the original numbers and the sum in red. You'll have to do that for yourself. The functions are in conio.h and require you to use cprintf() (color won't affect printf() ). However I can't remember what the functions are called.
    For extra marks use strtol() instead of atoi() and abort if not passed a valid number.
  • Malcolm_McLeanMalcolm_McLean Member Posts: 254 ✭✭
    This post has been deleted.
  • LundinLundin Member Posts: 3,711
    Malcolm,
    I removed one of your duplicate posts, but there was some tech issue when I did so. I noticed that the Programmer's Heaven site isn't behaving properly at the moment... so if you got any weird message in your mail because of the deletion, kindly disregard it.

    C/C++ mod.
Sign In or Register to comment.