C program to print r diagonal triangle, C/C++ Programming

Assignment Help:

C program to print R diagonal triangle:

#define rows 3

#define cols 3

void main()

{

                int i=0,j=0;

                int arr[rows][cols];

                for (i=0; i<=rows-1; i++)

                                for(j=0;j<=cols-1;j++)

                                {

                                                printf("Enter elements (%d,%d)\n",(i+1),(j+1));

 

                                                scanf("%d",&arr[i][j]);

                                }

                for (i=0; i<=rows-1; i++)

                {

                                printf("\t");       

                                for(j=0;j<3;j++)

                                                {

                                                printf("%d  ",arr[i][j]);

                                                }

                                                printf("\n");

                }

                printf("\n Revers of matrix\n");

                for(i=0;i<=rows-1;i++)

                {

                                printf("\t");

                                for(j=0;j<=cols-1;j++)

                                {

                                                if(i+j==2)

                                                printf("%d  ",arr[i][j]);

                                                else

                                                                printf("   ");

                                }

                                                printf("\n");

                }

 

 

}

 

 


Related Discussions:- C program to print r diagonal triangle

Example of switch case statement, #include #include #include void* m...

#include #include #include void* memorycopy (void *des, const void *src, size_t count) {   size_t n = (count + 7) / 8;   char* destination = (char *) des;   char* source =

Explain different access specifiers in a class, Question 1 Create a class ...

Question 1 Create a class String which stores a string value. Overload ++ operator which converts the characters of the string to uppercase (toupper() library function of "ctype.h

Program to find the number, i need a program that find the number of negati...

i need a program that find the number of negative integers in a list.

Plz reply on [email protected], You are to implement a code cracking ...

You are to implement a code cracking system. The system will deploy four processes (p1,p2,p3 & p4) to try to guess the password of an encrypted code. For encryption, we consider th

Develop stocastic expert advisor, Project Description: Need to develop a...

Project Description: Need to develop an expert advisor base on sthocastic oscilator with my own setting.. Very basic touch line OB/OS only but on my setting n condition Skill

Explain virtual functions, Virtual Functions The keyword virtual was pr...

Virtual Functions The keyword virtual was previously used to resolve ambiguity for a class derived from two classes, both having a common ancestor. These classes are known as v

Can you think of a condition where your program would crash , Can you think...

Can you think of a condition where your program would crash without attaining the breakball, which you set at the straining of main()? A: C++ let for dynamic initialization of g

Structures, please answer the question of following Write a function that c...

please answer the question of following Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? B

Write a program that illustrate command line parameters, Write a Program th...

Write a Program that illustrate Command Line Parameters? main(int argc, char *argv[]) { int i; for(i = 0; i printf("arg %d: %s\n", i, argv[i]); return 0; }

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd