How we print the table of 2 using for loop in c
programing?
Answers were Sorted based on User's Feedback
Answer / muavia
#include<stdio.h>
#include<conio.h>
void main(void)
{
printf("Which table you want: ");
int t;
scanf("%d",&t);
for (int i=1;i<11;i++)
printf("\n%d * %d = %d",t,i,t*i);
getch();
}
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / amit kumar singh
#include<stdio.h>
#include<conio.h>
void main()
int i;
printf("the table of two no");
for(i=1;i<=10;i++)
{
printf("
%d",r*2);
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / chandan partap singh
#include<stdio.h>
#include<conio.h>
void main()
{
int i,c;
clrscr();
printf("Table of 2
");
for(i=1;i<=10;i++)
{
printf("2*%d=%d
",i,2*i);
}
getch();
}
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / sandeep tayal
If you are looking for printing a table using c in unix
environment where c is actually used you can find the
following link helpful.
http://myblogs.netne.net/program-to-print-table-of-2-in-c-using-vi/
Is This Answer Correct ? | 8 Yes | 9 No |
#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
How do you write a program which produces its own source code as its output?
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
How to access command-line arguments?
4. Main() { Int i=3,j=2,c=0,m; m=i&&j||c&I; printf(“%d%d%d%d”,I,j,c,m); }
what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }
main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
plz send me all data structure related programs
main() { char a[4]="HELL"; printf("%s",a); }