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 / anil kumar nahak

#include<stdio.h>
#include<conio.h>
void main()
{
int num=2,r;
clrscr();
printf("\n The Table Of Number Two \n");
for(r=1;r<=10;r++)
{
printf("\n %d * %d = %d",num,r,num*r);
}
getch();
}

Is This Answer Correct ?    333 Yes 93 No

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

Answer / shruthi

int i,result;

for(i=1;i<=10;i++)
{
result=i*2;
printf("%d\n",result);
}

Is This Answer Correct ?    174 Yes 58 No

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

Answer / hemendra singh gurjar

#include<stdio.h>
#include<conio.h>
void main()
{
int r;
clrscr();
printf("\n The Table Of Number Two \n");
for(r=1;r<=10;r++)
{
printf("\n%d",r*2);
}
getch();
}

Is This Answer Correct ?    79 Yes 23 No

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

Answer / jitender singh

#include<stdio.h>
#include<conio.h>
Void main()
{
Int r;
Clrscr();
Printf("\n The table of Number Two \n");
for(r=1;r<=10;r++)
{
printf("\n%d",r*2);
}
getch();
}

Is This Answer Correct ?    44 Yes 20 No

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

Answer / vaibhav

int i,result;

for(i=1;i<=10;i++)
{
result=i*2;
printf("%d\n",result);
}

Is This Answer Correct ?    36 Yes 26 No

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

Answer / mohib ullah orakzai

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a=2,b;
for(int c=1;c<=10;c++)
{
b=a*c;
cout<<a<<"*"<<c<<"="<<b<<endl;
}
getch();
}

Is This Answer Correct ?    24 Yes 15 No

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

Answer / laxmi kanth

#include<stdio.h>
main()
{
int a,n;
printf("/nenter the table:\n");
scanf("%d",&a);
for(n=1;n<=10;n++)
printf("\nthe table is:\n%d*%d=%d,a,n,a*n);
}

Is This Answer Correct ?    18 Yes 13 No

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

Answer / naresh

#include<stdio.h>
int main(void)
{
int a=2,c;
for(c=1;c<=10;c++)
{
printf("%4d",a*c);
}
return 0;
}

Is This Answer Correct ?    12 Yes 7 No

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

Answer / dipankar kumar

Yes

Is This Answer Correct ?    20 Yes 18 No

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

Answer / aik expert

<?php
for ($a=0; $a<=10; $a++)
{
$b=$a*3;
echo "3*$a=$b<br>";

}
?>

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }

1 Answers  


What are segment and offset addresses?

2 Answers   Infosys,


main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }

1 Answers  


Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

2 Answers  






Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

1 Answers  


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

1 Answers  


main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000

3 Answers   HCL,


source code for delete data in array for c

1 Answers   TCS,


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4

2 Answers   HCL,


how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.

19 Answers   Cap Gemini, Infosys,


Categories