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() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
What is the hidden bug with the following statement? assert(val++ != 0);
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);
Is the following code legal? typedef struct a { int x; aType *b; }aType
Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.
1 Answers Samar State University,
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
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"
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come