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 |
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.
19 Answers Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,
Printf can be implemented by using __________ list.
#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }
main() { printf("%d", out); } int out=100;
Is this code legal? int *ptr; ptr = (int *) 0x400;
why the range of an unsigned integer is double almost than the signed integer.