My Hindi Forum

Go Back   My Hindi Forum > New India > Young World
Home Rules Facebook Register FAQ Community

Reply
 
Thread Tools Display Modes
Old 29-01-2013, 05:15 PM   #1
dipu
VIP Member
 
dipu's Avatar
 
Join Date: May 2011
Location: Rohtak (heart of haryana)
Posts: 10,193
Rep Power: 91
dipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond repute
Send a message via Yahoo to dipu
Default C Program for Ramanujam's Magic square

#include<stdio.h>
#include<conio.h>
void main()
{
int a[20][20],r,c,br,bc,k,n;
clrscr();
printf("Enter the Order of Magic Square(Odd): ");
scanf("%d",&n);
for(r=0;r<n;r++)
for(c=0;c<n;c++)
a[r][c]=0;
r=0;
c=n/2;
for(k=1;k<=n*n;k++)
{
a[r][c]=k;
br=r++;bc=c++;
r=(r+1)%n;
c=(c+1)%n;
if(a[r][c]!=0)
{
c=bc;
r=br-1;
if(r<0)r=n-1;
}
}
printf("The Magic Square...\n");
for(r=0;r<n;r++)
{
for(c=0;c<n;c++)
printf("%4d",a[r][c]);
printf("\n");
}
}
__________________



Disclamer :- All the My Post are Free Available On INTERNET Posted By Somebody Else, I'm Not VIOLATING Any COPYRIGHTED LAW. If Anything Is Against LAW, Please Notify So That It Can Be Removed.
dipu is offline   Reply With Quote
Old 30-01-2013, 08:37 AM   #2
Awara
Special Member
 
Awara's Avatar
 
Join Date: Dec 2012
Location: फूटपाथ
Posts: 3,861
Rep Power: 23
Awara is a splendid one to beholdAwara is a splendid one to beholdAwara is a splendid one to beholdAwara is a splendid one to beholdAwara is a splendid one to beholdAwara is a splendid one to beholdAwara is a splendid one to behold
Default Re: C Program for Ramanujam's Magic square

nice pg.. thanks for sharing..
__________________
With the new day comes new strength and new thoughts.
Awara is offline   Reply With Quote
Old 30-01-2013, 06:08 PM   #3
dipu
VIP Member
 
dipu's Avatar
 
Join Date: May 2011
Location: Rohtak (heart of haryana)
Posts: 10,193
Rep Power: 91
dipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond reputedipu has a reputation beyond repute
Send a message via Yahoo to dipu
Default Re: C Program for Ramanujam's Magic square

Quote:
Originally Posted by Awara View Post
nice pg.. thanks for sharing..
__________________



Disclamer :- All the My Post are Free Available On INTERNET Posted By Somebody Else, I'm Not VIOLATING Any COPYRIGHTED LAW. If Anything Is Against LAW, Please Notify So That It Can Be Removed.
dipu is offline   Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT +5. The time now is 11:27 AM.


Powered by: vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
MyHindiForum.com is not responsible for the views and opinion of the posters. The posters and only posters shall be liable for any copyright infringement.