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<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 Answers  


#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

1 Answers  


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

7 Answers  


int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"

2 Answers  


Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  


main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above

3 Answers   BrickRed, HCL,


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

2 Answers  


{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

4 Answers  


main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above

1 Answers   HCL,


main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024

2 Answers   HCL,


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

0 Answers   Microsoft,


Categories