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

Assignment Help:

C program to print L diagonal triangle:

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)

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

                                                else

                                                                printf("   ");

                                }

                                                printf("\n");

                }

 

 

}


Related Discussions:- C program to print l diagonal triangle

Explain input output function, Input Output Most languages have "statem...

Input Output Most languages have "statements" to perform I/O . Though in C and C++ we use "functions" to perform I/O. C++ also has its own I/O mechanism - the cin and cout obje

Program to find a greatest string: c - program , Program to find a Greatest...

Program to find a Greatest String: C - Program: Write a program find largest string by c program. int main( int argc, char *argv[] ) {     if( argc         {

Define four facilities provided by c language preprocessor, Define Four Fac...

Define Four Facilities Provided by C Language Preprocessor? The C language preprocessor provides four separate facilities that you can use as you see fit:   Inclusion

.C# mouse and maze program, .Create a Csharp solution that will show a maze...

.Create a Csharp solution that will show a maze in the user interface and will show a mouse walking through the maze attempting to locate the exit door (the cheese).

Draw a circle in c program , Draw a circle in c program: void main() ...

Draw a circle in c program: void main() { clrscr(); int i,r=50,t,j,x,y; int gd,gm; gd =DETECT; initgraph(&gd,&gm,""); for(x=50;x for(y=50;y {   i

Minimum shelves, write a program to find the minimum number of shelves

write a program to find the minimum number of shelves

Area, Write a program to find the area under the curve y = f(x) between x =...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Source code for decoe to code, i am using mobile phone if i want to communi...

i am using mobile phone if i want to communicate via massage but that should be very secret

Custom scans and alerts think or swim, Custom Scans and Alerts Think or Swi...

Custom Scans and Alerts Think or Swim Project Description: I am seeking somebody to make me several Custom Scans and Alerts on Thinkorswim TOS Skills required are C++ Prog

Program to print a series, Write a program called Series that will print/di...

Write a program called Series that will print/display a series of numbers starting with 1 and ending with the last number that is less than 30. The series should include only odd n

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