UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I print a list of descending numbers in C in a square shape?

Asked by Last Modified  

Follow 3
Answer

Please enter your answer

Trainer

int n,i,j; n = d*d; for(i=0;i
Comments

Trainer

it will take two loops, firstly decide the dimension of the square i.e 3*3 or 4*4 etc if it is 3*3 then the number will start from 9 and if it is 4*4 then the number will start from 16 then 15 etc. Which means you can take the dimension from the user and run the first loop up till that dimension after...
read more
it will take two loops, firstly decide the dimension of the square i.e 3*3 or 4*4 etc if it is 3*3 then the number will start from 9 and if it is 4*4 then the number will start from 16 then 15 etc. Which means you can take the dimension from the user and run the first loop up till that dimension after that in the next loop print the number up till that dimension, which means your inner loop will also run the number of time the dimension is given. e.g. int outer,inner,dimension,value; now take dimension value from user then value = dimension * dimension ; after that run two loop. or you can do in inside one loop also. take the dimension value = dimension * dimension; value2 = dimension * (dimension + 1); then take one more variable count =0; then for(outer = 0;outer < value2 ; outer++){ count++; if(count == 3){ change the line; continue; count =0; }else{ print(the value) value --; and change the line; } } fine any doubt let me know if I am wrong also. read less
Comments

Trainer

read elements in array and sort them . then depending on no of elements , use the method to print like a matrix
Comments

View 1 more Answers

Related Questions

What is the difference between ++var and var++?
First one is present increment and second one is the post incremental t of the variable. Both increases value of var to one. The difference between pre and post increment is given in below example. Int...
Chittaranjan
What is the difference between n=1 and n==1 in the C language?
'=' is ASSIGNMENT operator , where as '==' is COMPARISON operator. int a=7; assigns the variable a an integer value 7 , where as a==7; checks if the VALUE of a is EQUAL to 7.
Soujanya
0 0
8
How do I learn C programming effectively? What is the best book?
C: The Complete Reference is written by Herbert Schildt is one of the best book for beginners
Sk
0 0
7
What is important topics in C-language for interviews???
Functions, Arrays , String, pointers , structures
Gayu
What are pointers in C language?
Hi Imran, Hope you are doing good. Are you looking for short answer or long answer? :) Pointers in C are variables that store memory addresses. They point to the location of another variable, allowing...
Imran
0 0
7

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Understanding Computer Science Concepts with Images and Videos..
All Computer science concepts relating to programming and software development are only virtual. It cannot be practically shown as a hardware parts of a computer. But for better understanding it should...

C Program-Prime Number
/*WAP to print a number entered by the user is prime or not*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ int num,i; //Function for clearing screen clrscr();...

Lets know about far, near and huge pointers for fresher interview purpose
All of these three candidates relate to 16 bit architecture where segmented memory architecture was there. They are not at all relevant for present days 32 or 64 bit architecture where the way of memory...

Internet of Things, Social Media Becoming Part of E-Discovery Landscape
The days when e-discovery consisted of handing over copies of e-mails to address Freedom of Information Act (FOIA) requests, compliance regulations or other legal obligations are over. Now, it's just as...

C, Cpp, Java, Python, Javascript Programming Languages
Learning C is as good as Learning a Natural Language(such as English, Hindi, Telugu, Tamil etc) We use Natural Languages to communicate with humans whereas we use Programming Languages such as C, Cpp,...
V

Vamshi

0 0
0

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more