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 a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }

1 Answers  


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,


how can i search an element in an array

2 Answers   CTS, Microsoft, ViPrak,


void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  


void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }

3 Answers  






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

1 Answers  


Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


why java is platform independent?

13 Answers   Wipro,


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

2 Answers  


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,


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

1 Answers  


struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above

2 Answers   HCL,


Categories