what will be the output for in range (2,4,1). print i
those girls will answer my question please give their contact no.
Answers
Answered by
0
Answer:
How do I get this output (1*1=1, 2*1=2, 2*2=4, 3*1=3, 3*2=6, 3*3=9, 4*1=4, 4*2=8, 4*3=12, 4*4=16, 5*1=5, 5*2=10, 5*3=15, 5*4=20, 5*5=25) in
1*1=1
2*1=2
2*2=4
As so on up to 5. Let's take n=5 where n is range.
If you observe in the printing of 2*…=…
We can write 2*j=(2*j);
And also it can be written as i*j=(i*j);
Where i is varying from 1 to n=5. And
j is varying from 1 to i.
By using for loop we can obtain output as:
#include <stdio.h>
int main()
{
int i,j,n=5;
for(i=1 ;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("\n%d*%d=%d\t",i,j,(i*j));
}
printf("\n");
}
return 0;
}
Output:
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9
4*1=4 4*2=8 4*3=12 4*4=16
5*1=5 5*2=10 5*3=15 5*4=20 5*5=25
Hope this helps:)
Similar questions
Computer Science,
2 months ago
Math,
9 months ago