100% prog for printing magic table on given birth date
#include <stdio.h>
int main()
{
int i,j,n,a[4][4],b[8],total=0;
printf("\n program to generate magic square as per gaNitamtO gammattulu (gAraDeelu)");
printf("\n enter the number that u want as output in the game:");
scanf("%d",&n);
for(i=0;i<7;i++)
{
printf("\n enter a integer:");
scanf("%d",&b[i]);
total=total+b[i];
}
printf("\n\n the following is a magic square whose output is :%d\n\n",n);
b[7]=n-total;
for(i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
a[i][j]=b[i]+b[4+j]; // క్లాస్ లోచెప్పుకునేప్పుడు తొలుత b[i]+b[i+4+j] అనుకున్నాం.
printf("%5d",a[i][j]);
}
printf("\n");
}
}
ఔట్పుట్ తెరమీద
program to generate magic square as per gaNitamtO gammattulu (gAraDeelu)
enter the number that u want as output in the game:9
enter a integer:1
enter a integer:2
enter a integer:3
enter a integer:5
enter a integer:-2
enter a integer:4
enter a integer:-4
the following is a magic square whose output is :9
-1 5 -3 1
0 6 -2 2
1 7 -1 3
3 9 1 5
enter the number that u want as output in the game:9
enter a integer:1
enter a integer:2
enter a integer:3
enter a integer:5
enter a integer:-2
enter a integer:4
enter a integer:-4
the following is a magic square whose output is :9
-1 5 -3 1
0 6 -2 2
1 7 -1 3
3 9 1 5
మరోసారి చేస్తే ఔట్పుట్ తెరమీద
program to generate magic square as per gaNitamtO gammattulu (gAraDeelu)
enter the number that u want as output in the game:12
enter a integer:2
enter a integer:-1
enter a integer:-3
enter a integer:0
enter a integer:4
enter a integer:7
enter a integer:8
the following is a magic square whose output is :12
6 9 10 -3
3 6 7 -6
1 4 5 -8
4 7 8 -5
enter the number that u want as output in the game:12
enter a integer:2
enter a integer:-1
enter a integer:-3
enter a integer:0
enter a integer:4
enter a integer:7
enter a integer:8
the following is a magic square whose output is :12
6 9 10 -3
3 6 7 -6
1 4 5 -8
4 7 8 -5
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.