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 ...
Printable View
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 ...
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
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
So what have you done so far?
--
Mats
i dont know what to edit in it... it`s not generating into a table formCode:#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);
}
No, you'll need some sort of loop to perform the calculation several times.
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("%3d * %3d = %3d\n", i, 2, i * 2);
}
return 0;
}