#include
#include
void main()
{
clrscr();
for (int i=1;i<=5;i++) // this for loop controls the line
{
for(int
j=1;j<=i;j++) // this for loop controls the values(1,12,123..)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
Chat with our AI personalities
There is no such thing as a "magic number". You are probably thinking of magic squares where the sum of each row, column and major diagonal has the same "magic" value.
REMPATTERNS (not necessary) CLS FOR I = 1 TO 5 STEP +1 FOR J = 1 TO I STEP+1 PRINT J NEXT J PRINT NEXT I END Hope you find this helpful :)
====== FOR tablesNo%=1 TO 12 CLS PRINT "PROGRAM: "; tablesNo%; "X Tables:-" PRINT FOR timesNo%=1 TO 12 PRINT timesNo%; " X "; tablesNo%; " = "; timesNo%*tablesNo% NEXT PRINT PRINT "Press [SPACEBAR] key to continue..." SLEEP NEXT END
write a program to print the series 1/12+1/22+.........+1/n2 ?
num%=9 CLS PRINT "The square of: "; num%; " = "; num%*num% END
// example of 1..12x12 table for($i = 1; $i <= 12; $i++) { for($j = 1; $j <= 12; $j++) { print ($i * $j) ." "; } print "\n"; }