How we print the table of 3 using for loop in c
programing?
Answers were Sorted based on User's Feedback
Answer / chitra
int i,no;
for(i=1;i<=10;i++)
{
no=i*3;
printf("%d",no);
}
Is This Answer Correct ? | 22 Yes | 5 No |
Answer / tevendra singh pardhi
#include<stdio.h>
main()
{
int i,ans;
for(i=1;i<=10;i++)
{
ans=3*i;
printf("%d",&ans) ;
}
return 0;
}
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sanjay kr marandi
#include<stdio.h>
main()
{
int n,i,t=1;
printf("/nEnter a table:");
scanf("%d",&n);
for(i=1;i<=10;i++)
{
t=n*i;
printf("%dX%d=%d\n",n,i,t);
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / k.anuroop
#include<stdio.h>
main()
{
int a,i;
i=0;
for(i=0;i<21;i++)
{
a=3*i;
printf("\n3*%d=%d",i,a);
}
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / salu
\\its work for any table u want :)\\
#include<stdio.h>
#include<conio.h>
int main ()
{
int i=0;
int j=0;
int k=1;
int no=0;
printf("ENTER table no :");
scanf("%d",&i);
printf("ENTER lenght:");
scanf("%d",&j);
for (k=1;k<=j;k++)
{no=k*i;
printf("%d*%d=%d\n",i,j,no);
}
getch();
}
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / chitra
int i;
for(i=1;i<=10;i++)
{
i=i*3;
printf("%d",i);
}
Is This Answer Correct ? | 11 Yes | 20 No |
main() { char c=' ',x,convert(z); getc(c); if((c>='a') && (c<='z')) x=convert(c); printf("%c",x); } convert(z) { return z-32; }
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
WAP to display 1,2,3,4,5........N
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
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.
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }