newbei at C programin.. plz hlp .. paper on 17th nov.. :(

This is a discussion on newbei at C programin.. plz hlp .. paper on 17th nov.. :( within the C Programming forums, part of the General Programming Boards category; i want to make a table of 2 ok... a simple program.. now i`m having problms in for loop.. plz ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Location
    Pakistan
    Posts
    4

    Exclamation newbei at C programin.. plz hlp .. paper on 17th nov.. :(

    i want to make a table of 2 ok... a simple program.. now i`m having problms in for loop.. plz can ne 1 explain me.. the whole program... also the coding and how it work ...

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You may have to explain a little bit better what you want to do - and we don't write code for others here - we help you to write the code.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Location
    Pakistan
    Posts
    4
    me a newbei soo... actually having loads of problem..
    actually i want to make a program in which i want to make a table of 2... i.e
    2*1=2
    2*2=4 and so on...
    i want u pplz to explain what to do step by step.. thats it and nothng else

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So what have you done so far?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Location
    Pakistan
    Posts
    4
    Code:
    #include <stdio.h>
    void main (void)
    {
    int a,b,c;
    printf ("enter a no");
    for (a=1;a<6;a++)
    scanf ("%d",&a);
    c=a*b;
    printf ("%d*%d=%d",a,b,a*b);
    }
    i dont know what to edit in it... it`s not generating into a table form

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    No, you'll need some sort of loop to perform the calculation several times.
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Hacker MeTh0Dz's Avatar
    Join Date
    Oct 2008
    Posts
    111
    You tried, so I thought I'd help you out.

    Code:
    #include <stdlib.h>
    #include <stdio.h>
    
    int main(int argc, char * argv[])
    {
    	int i;
    	
    	for (i = 1; i <= 10; i++) {
    		printf("&#37;3d   * %3d   = %3d\n", i, 2, i * 2);
    	}
    	
    	return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c++ help needed
    By ettore in forum C++ Programming
    Replies: 17
    Last Post: 01-18-2008, 12:20 PM
  2. Issues and questions about queues
    By Nazgulled in forum C Programming
    Replies: 36
    Last Post: 12-13-2007, 02:03 PM
  3. Another rock paper scissor question
    By mattflick in forum C Programming
    Replies: 11
    Last Post: 09-29-2005, 10:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21