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

void pascal f(int i,int j,int k) { printf(ā€œ%d %d %dā€,i, j, k); } void cdecl f(int i,int j,int k) { printf(ā€œ%d %d %dā€,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }

1 Answers  


main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }

1 Answers  


main() { show(); } void show() { printf("I'm the greatest"); }

2 Answers  


how can u draw a rectangle in C

53 Answers   Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,


struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }

1 Answers  






C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


Finding a number multiplication of 8 with out using arithmetic operator

8 Answers   Eyeball, NetApp,


Write a program that find and print how many odd numbers in a binary tree

1 Answers  


void main() { int c; c=printf("Hello world"); printf("\n%d",c); }

2 Answers  


main() { if ((1||0) && (0||1)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above

5 Answers   HCL,


What is the hidden bug with the following statement? assert(val++ != 0);

1 Answers  


String copy logic in one line.

11 Answers   Microsoft, NetApp,


Categories