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

Is it better to bitshift a value than to multiply by 2?
yes in bitshifting operation, u know the shifting position of bit
Nadare
0 0
5
Can the last case of a switch statement skip including the break?
Last case if a switch should be DEFAULT.. Good to have this case always. Executed only when there's no other matching cases found.
Sanjeev
What is the benefit of using enum to declare a constant?
ENUMS.. Can give numerical values for Sunday, Monday,... Easy to use in coding... Makes the program more readable/ understandable, than using 1,2,3.. Etc.
Sita
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

C Programming basics
C PROGRAMMING BASICS 10 Hours Introduction to ‘ C’ programming –fundamentals – structure of a ‘C’...
O

Om K.

0 0
0

C++ Program-Working with constant using #define preprocessor
//Header Files #include#include // using #define preprocessor for defining a constant#define len 10#define br 5#define rad 3#define NEWLINE '\n' //Main function void main(){ int area_r; float area_c; //Function...

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();...

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

Tips of learning Java Language/Other Programming Languages
1.You should know the basic concept: If we talk about programming languages so basic concept are same in all the high level languages. So you should know the basic concept firstly then you can easily understand...
I

ICreative Solution

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