User Profile

Collapse

Profile Sidebar

Collapse
kpdp
kpdp
Last Activity: Mar 29 '09, 08:56 PM
Joined: Nov 21 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • kpdp
    replied to loop code
    in C
    nevermind...
    it's

    #include<stdio. h>

    int main (void)
    {
    int i, sum=0;
    for (i=1; i<=21; i=i+2) {
    (sum = sum + i);

    printf("%d\n", i);
    }
    return 0;

    }
    See more | Go to post

    Leave a comment:


  • kpdp
    started a topic loop code
    in C

    loop code

    hey,
    i know that this is a really easy question...but i can't seem to figure out what's wrong with the code.. this function is meant to state every odd number.

    #include<stdio. h>

    int main (void)
    {
    int i, sum=0;
    for (i=1; i<=21; i=i+2) {
    (sum = sum + 1);

    printf("%d\n",s um );
    }
    return 0;

    }
    See more | Go to post

  • kpdp
    replied to pointers...
    in C
    ohhhhh,,,,okay! that makes sense. thx!
    See more | Go to post

    Leave a comment:


  • kpdp
    started a topic pointers...
    in C

    pointers...

    Hey.
    Can anyone tell me why we need pointers when swapping varibles such as:
    void swap (int *x, int *y)
    {
    int temp;
    temp = *x;
    *x =*y;
    *y = temp;
    }

    int x=12, y=4
    swap (&x,&y);

    why would they swap values, as opposed to using...

    void swap (int x, int y)
    {
    int temp;
    temp = x;
    x =y;...
    See more | Go to post

  • kpdp
    replied to remove punctuation in C
    in C
    I'm sorry. I have just started learning programming so I am trying to teach myself the basics with functions and strings.
    My question is that how do i write something like "My name is Peter" and I get back "mynameispe ter" ?
    How do i use the function?
    See more | Go to post

    Leave a comment:


  • kpdp
    replied to remove punctuation in C
    in C
    so, i think when you are using the remove_punc function, you have to write the script so that it keeps in the characters, while removing the punctions.
    See more | Go to post

    Leave a comment:


  • kpdp
    started a topic remove punctuation in C
    in C

    remove punctuation in C

    hey,
    can anyone help me write up a function to remove space, semicolons, etc?
    ty.
    See more | Go to post
No activity results to display
Show More
Working...