How we print the table of 2 using for loop in c
programing?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
#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); }
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.
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); } }
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
What is the hidden bug with the following statement? assert(val++ != 0);
Write a C program to add two numbers before the main function is called.
why java is platform independent?
main() { extern int i; i=20; printf("%d",sizeof(i)); }
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
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }
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