How we print the table of 2 using for loop in c
programing?

Answers were Sorted based on User's Feedback



How we print the table of 2 using for loop in c programing?..

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

How we print the table of 2 using for loop in c programing?..

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

How we print the table of 2 using for loop in c programing?..

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

How we print the table of 2 using for loop in c programing?..

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

Post New Answer

More C Code Interview Questions

#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

1 Answers  


#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); }

1 Answers   TCS,


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


How do you write a program which produces its own source code as its output?

7 Answers  


main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

6 Answers  


How to access command-line arguments?

4 Answers  


4. Main() { Int i=3,j=2,c=0,m; m=i&&j||c&I; printf(“%d%d%d%d”,I,j,c,m); }

2 Answers   Broadridge,


what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }

10 Answers  


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


&#8206;#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  


plz send me all data structure related programs

2 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


Categories