How we print the table of 2 using for loop in c
programing?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Write a C program to add two numbers before the main function is called.
int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
how to concatenate the two strings
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
main() { static int var = 5; printf("%d ",var--); if(var) main(); }
hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
what is oop?
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }