C Program 1 Answer(s) 3 years and 5 months ago
Posted in : Development process
View Answers
December 17, 2009 at 5:25 PM
Hi Friend,
Try the following code:
#include <stdio.h> #include <conio.h>
void main(){ int d[3][3]={1,2,6,3,8,5,5,6,7}; int k=0,j=0; int sum1=0,sum2=0; for(j=0;j<3;j++){ for(k=0;k<3;k++) printf(" %3d",d[j][k]); printf("\n"); } for(j=0;j<3;j++) { sum1=sum1+d[j][j]; } k=3-1; for(j=0;j<3;j++) { if(k>=0){ sum2=sum2+d[j][k]; k--; } } printf("Sum of First diagonal= %d\n",sum1); printf("Sum of Second diagonal= %d",sum2); getch(); }
Thanks
Related Pages:
program of c program of c write a program in c to display a to z without using printf or scanf statements or header files
c++ program c++ program Write a program which reads a text from the keyboard and displays the following information on the screen in two columns:
(a) Number of lines
(b) Number of words
(c) Number of characters
Strings should be left
C Program C Program Why doesn't the code
int a = 1000, b = 1000;
long int c = a * b;
work?
plz help me sir
c program c program How to convert binary digits to decimal number without using power function
C# C# i need a code that will make program perform the basic operations upon the data Listview save, update and cancel
c program c program plz send me program for this. write a program to print the following code? (in c language)
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11
2 3 4 5 6 7 8 9 10
c++ c++ write a program that gets a key or character from the keyboard and displays it ASII code in decimal, hexadecimal and binary form.It must also give a description of the key pressed
c++ c++ .write a program that accepts 5 subjects of a student,it should have a function to calculate the average & another function to grade.grade should be as follows-<40=E,40-49=D,50-59=C,60-69=B & >70
C program C program hi, here is my question:
Create a structure to specify data on students given below: Roll number, Name,Department, Course, Year... a function to print names of all students who joined in a particular year. (c
c program c program plz send me program for this. write a program to print the following code?
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10 11
2 3 4 5 6 7 8 9 10 11 12
3 4
program in c program in c Write a program that inputs five different integers from the keyboard, then print the sum, the product, the smallest and the largest of these numbers. Use only single selection form of if statement.
For example: 1 3
c++ c++ Write the definition of the class dayType that implements the day of the
week in a program. The class dayType should store the day, such as
Sunday for Sunday. The program should be able to perform the following
operations
c++ c++ Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo... name with the minimum GPA
7) Display Student GPAs as Letter Grades (A, B, C, D
method overloading in c program
method overloading in c program how is method overloading in Cprogram is different from C++ program
malloc in c example program
malloc in c example program What is malloc in c? Please explain the term using an example in Cprogram.
Thanks
C program - SQL C program Write a Cprogram for airport simulation using queue data structures.
Please reply me
c program - IoC c program given the string "wordprocessing",write a program to read the string from the terminal and display the same in the following formats:
a) word processing
b) word
processing
c) w.p.
c program - Java Beginners c program 1. How to write a program to Add 2 numbers without using int .size should be more than machine size
C Program - Development process C Program Cprogram to find division of two fraction number without...:
#include
#include
#include
int main () {
int a;
int b;
int c;
int... in the form a/b: ");
scanf("%d/%d", &c, &d);
nr=a*d;
dr=b*c;
printf("%d/%d",nr,dr
C program - Java Magazine C program develop a simple program in C that allows a user to enter... and then the program;
a)First determines whether the 3 integers entered represent the sides..., the program should print the following;
The three integers form a Right-angled
C program - SQL C program Thank You .
Write some C programs using pointers .
Write some C programs using files.
Please reply me . Hi Friend,
Please visit the following link:
http://www.roseindia.net/c
C program - SQL C program write a Cprogram to print multiplication table using pointers. Hi Friend,
Try the following code:
#include
#include
void main() {
int i,j;
int * pt;
clrscr();
printf(" ");
printf("\n
about a program in c language
about a program in c language Write a program that inputs five different integers from the keyboard, then print the sum, the product, the smallest and the largest of these numbers. Use only single selection form of if statement
C Programming SubString Program C Programming SubString Program Sir I want to Check whether the Single Substring is present in the given 3 string. characters.
eg if i entered... entered to check PROGRAM is exists in given three strings then output
c++ program of inheritance c++ program of inheritance Assume that a bank maintains two kinds of accounts for customers, one called as savings account and the other as current....
(b) Display the balance
(c) Compute and deposit interest.
(d) Permit
C Program....PLEASE HELP CProgram....PLEASE HELP For this assignment, you are to write a program that calculates points along a rhodonea curve,
a.k.a. a mathematical rose, and produces a simple character plot of the results, using functions,
arrays
C Program - Development process C Program How to do sum of Diagnol Matrix
e.g
3 6 9
4 5 7
7 6 9
I want to display sum of 3+5+9 i.e to do sum of Diagnol Matrix
plz Help Me Hi Friend,
Try the following code:
#include
#include
C program - SQL C program Thanks!!!!!!!!!!
Please reply me some programs for DATA STRUCTURES (LINKED LISTS,ETC) Hi Friend,
Try the following code:
# include
# include
#include
struct element *temp;
struct
c or c++ - Java Beginners c or c++ Write a program for a two user chess game(Users must be on different systems)? please send me this source code to my mail id with step by step explanation
C Program Question - Development process CProgram Question How i can calulate sum of First digit and last digit of Five Numbers.
e.g 12345
i want to calculate 1+5=6
how i can calculate in CProgram?
Hi Friend,
Try the following code
c programming c programming Write a Program in 'C' to print the following
output 'n' rows.
for example, if n:3, the following should
be output by the program :
1
1 2 L
r 2 3 2 1
1 2 L
1
c programming c programming Write a Program in 'C' to print the following
output 'n' rows.
for example, if n:3, the following should
be output by the program :
1
1 2 L
r 2 3 2 1
1 2 L
1
coding C
coding C Write a program for a GENERAL NUMBER CONVERTERS which include
binary, decimal, octa and hexadecimal. You need to write the program using C
language
C Programming C Programming hi,how can i write a program in C programming to place reservation in air plane from the menu let the user to inter his/her gender(W or M)and draw seats by using ascii codes and choose where he/she will sit
question for c++
question for c++ write Program to swap between two numbers if first number is greater than second number and total of two numbers greater than 10
program
program i want help to making a project in check current date using c language
program
program i want help to making a project in check current date using c language
java & c
java & c why c language is called top down approach?
why java is called bottom to top approach?
In C, compilation stats from the very top of the program code. In Java, on the other hand, we have user defined data
c++ programs c++ programs Write a program with the following
(a) A function to read two double type numbers from keyboard
(b) A function to calculate the division of these two numbers
(c) A try block to throw an exception when a wrong type
c++ programs c++ programs Write a program with the following
(a) A function to read two double type numbers from keyboard
(b) A function to calculate the division of these two numbers
(c) A try block to throw an exception when a wrong type
C++Tutorials
of standard C libraries are written beginning with a c. In order for the program...
C++ Tutorials
C++
Tutorial