Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Complete IIT AIEEE ICSE ISC PMT help forum

Complete help forum for students preparing for icse iit aieee cbse pmt and other related exams.Stay updated about all 2011 exams.
 
HomeHome  PortalPortal  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  India NewsIndia News  
Keywords
YEAR 2007 question ICSE 2010 RESULT CASE papers science 2006 computer physics prelim CLASS graph UNION 2009 2004 SELECT paper
Latest topics
» Nitration of aniline - IIT JEE 2018 Advanced - solved
SPIRAL matrix Program using My logic EmptyFri Jun 08, 2018 2:34 am by adianadiadi

» Diamagnetic - Paramagnetic - Ni(CO)4, [Ni(CN)4]2- and [NiCl4
SPIRAL matrix Program using My logic EmptyFri Apr 06, 2018 1:05 am by adianadiadi

» IIT JEE chemistry solved interactive question paper
SPIRAL matrix Program using My logic EmptySun Oct 29, 2017 12:11 pm by adianadiadi

» IIT JEE 2015 SOLVED QUESTION PAPER
SPIRAL matrix Program using My logic EmptyWed Oct 19, 2016 1:44 pm by adianadiadi

» IIT JEE chemistry solved questions
SPIRAL matrix Program using My logic EmptySat Jul 18, 2015 6:15 pm by adianadiadi

» General Description of Chinese Market for Foaming Agent ADC
SPIRAL matrix Program using My logic EmptyFri May 09, 2014 2:09 pm by happybaicaitou

» How to get Lowest Cost MBBS Admission?
SPIRAL matrix Program using My logic EmptyMon Feb 24, 2014 6:39 pm by MENTOR 2014

»  girl boy vashikaran specialist agori baba ji +91-9461165
SPIRAL matrix Program using My logic EmptyTue Jan 21, 2014 6:00 pm by krshastri

»  STRONG LOST LOVE SPELL +91-9461165176
SPIRAL matrix Program using My logic EmptyTue Jan 21, 2014 6:00 pm by krshastri

Top posters
abhas
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
Anu..i luv icse...:)
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
G-7
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
siya
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
Candy
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
jOhNy
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
Apurva
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
WinRrule
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
ambili
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 
saif
SPIRAL matrix Program using My logic Vote_lcapSPIRAL matrix Program using My logic Voting_barSPIRAL matrix Program using My logic Vote_rcap 



Search if you can't find it here

SPIRAL matrix Program using My logic

View previous topic View next topic Go down
AuthorMessage
saif
Active member
Active member



SPIRAL matrix Program using My logic Vide
PostSubject: SPIRAL matrix Program using My logic SPIRAL matrix Program using My logic EmptyWed Feb 24, 2010 12:49 am

7
1 2 3 4 5 6 7
24 25 26 27 28 29 8
23 40 41 42 43 30 9
22 39 48 49 44 31 10
21 38 47 46 45 32 11
20 37 36 35 34 33 12
19 18 17 16 15 14 13

But I am sure that it won't be asked tomorrow



import java.io.*;
class spiral
{

private static int arr[][];
private static int c=-1,r=0,count=0;
public static void main(String args[])throws IOException
{
BufferedReader obj =new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(obj.readLine());
arr=new int[n][n];
fill('R',n);

for(int i=n-1;i>=1;i--)
{
fill('D',i);
fill('L',i);
if(--i==0)break;
fill('U',i);
fill('R',i);
}

for(int i=0;i
Back to top Go down
WinRrule
Active member
Active member
WinRrule


SPIRAL matrix Program using My logic Vide
PostSubject: Re: SPIRAL matrix Program using My logic SPIRAL matrix Program using My logic EmptyFri Mar 12, 2010 5:30 pm

ur expectation was right..! SPIRAL matrix Program using My logic Icon_biggrin
Back to top Go down
RC
Active member
Active member
RC


SPIRAL matrix Program using My logic Vide
PostSubject: Re: SPIRAL matrix Program using My logic SPIRAL matrix Program using My logic EmptySat Mar 13, 2010 11:54 am

class S1002
{
void main(int n)
{
int a[][]=new int[n][n];int c=1;
for (int i = n-1, j = 0; i > 0; i--, j++)
{
for (int k = j; k < i; k++) a[j][k]=c++;
for (int k = j; k < i; k++) a[k][i]=c++;
for (int k = i; k > j; k--) a[i][k]=c++;
for (int k = i; k > j; k--) a[k][j]=c++;
}
//special case for middle element if N is odd
if (n % 2 == 1) a[(n-1)/2][(n-1)/2]=c++;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
System.out.print(a[i][j]+" ");
System.out.println();}
}

}
Back to top Go down
Sponsored content




SPIRAL matrix Program using My logic Vide
PostSubject: Re: SPIRAL matrix Program using My logic SPIRAL matrix Program using My logic Empty

Back to top Go down

SPIRAL matrix Program using My logic

View previous topic View next topic Back to top
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Complete IIT AIEEE ICSE ISC PMT help forum :: ISC :: ISC 2010 [Class xii] :: Computer-