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

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

1 Answers  


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

1 Answers  


main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }

1 Answers  


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

0 Answers   Home,


All the combinations of prime numbers whose sum gives 32

1 Answers   HHH,


#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


Write a complete program that consists of a function that can receive two numbers from a user (M and N) as a parameter. Then print all the numbers between the two numbers including the number itself. If the value of M is smaller than N, print the numbers in ascending flow. If the value of M is bigger than N, print the numbers in descending flow. may i know how the coding look like?

2 Answers  


Finding a number multiplication of 8 with out using arithmetic operator

8 Answers   Eyeball, NetApp,


In a gymnastic competition, scoring is based on the average of all scores given by the judges excluding the maximum and minimum scores. Let the user input the number of judges, after that, input the scores from the judges. Output the average score. Note: In case, more than two judges give the same score and it happens that score is the maximum or minimum then just eliminate two scores. For example, if the number of judges is 5 and all of them give 10 points each. Then the maximum and minimum score is 10. So the computation would be 10+10+10, this time. The output should be 10 because 30/3 is 10.

0 Answers   TCS,


# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }

1 Answers  


There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

1 Answers  


void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }

1 Answers  


Categories