【NO.3】 c program to caculate and display sum of two matrix
to and of sum two matrix display program
2023-09-14 09:10:15 时间
source code:
#include "stdafx.h"
/* display sum of two matrix*/
int _tmain(int argc, _TCHAR* argv[])
{
int a[3][3], b[3][3], c[3][3], i, j;
i = j = 0;
printf("input elements into the first matrix a[3][3]\n");
for (i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
scanf_s("%d", &a[i][j]);
}
}
printf("input elements into the first matrix b[3][3]\n");
for (i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
scanf_s("%d", &b[i][j]);
}
}
for (i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
c[i][j] = a[i][j]+b[i][j];
}
}
printf("the sum of the two matrix is below:\n");
for (i = 0; i < 3; i++)
{
for(j=0;j<3;j++)
{
printf("%d ",c[i][j]);
}
printf("\n");
}
getchar();
}
inputs and outputs:
![](//img-blog.csdn.net/20140604145847046?</p><p>watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGFpeWFuMjAxNA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
版权声明:本文博主原创文章,博客,未经同意不得转载。
相关文章
- How to code like a pro in 2022 and avoid If-Else
- NV12 to RGB
- 【已解决】bind: An attempt was made to access a socket in a way forbidden by its access permissions.
- ORA-26826: string apply coordinator and apply slave are unable to communicate. ORACLE 报错 故障修复 远程处理
- ORA-26883: Timeout due to string Apply process “string” while merge original Capture process “string” and cloned Capture process “string”. ORACLE 报错 故障修复 远程处理
- ORA-26901: string propagation sender in the combined capture and apply mode is to be suspended while apply is disabled. ORACLE 报错 故障修复 远程处理
- ORA-39237: Failed to load XML document string. Compare process aborted. ORACLE 报错 故障修复 远程处理
- ORA-48245: Attempt to Update/Delete when at EOF ORACLE 报错 故障修复 远程处理
- MySQL Error number: 4018; Symbol: ER_CANT_SET_ANONYMOUS_TO_GTID_AND_WAIT_UNTIL_SQL_THD_AFTER_GTIDS; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-010997; Symbol: ER_DD_UPGRADE_FAILED_TO_FETCH_TABLESPACES; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-011033; Symbol: ER_FAILED_TO_BUILD_DO_AND_IGNORE_TABLE_HASHES; SQLSTATE: HY000 报错 故障修复 远程处理
- ORA-02834: Server unable to open file ORACLE 报错 故障修复 远程处理
- ORA-03245: Tablespace has to be dictionary managed, online and permanent to be able to migrate ORACLE 报错 故障修复 远程处理
- MySQL Error number: MY-011357; Symbol: ER_KEYRING_FAILED_TO_GENERATE_KEY; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-011372; Symbol: ER_KEYRING_FAILED_TO_FLUSH_KEYS_TO_KEYRING; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-011417; Symbol: ER_KEYRING_AWS_FAILED_TO_OPEN_CONF_FILE; SQLSTATE: HY000 报错 故障修复 远程处理
- ORA-12231: TNS:No connection possible to destination ORACLE 报错 故障修复 远程处理
- ORA-13041: failed to compare tile with element string.string.string ORACLE 报错 故障修复 远程处理
- PostgreSQL HV00N: fdw_unable_to_establish_connectionP0000 plpgsql_error 报错 故障修复 远程处理
- Scalaz(35)- Free :运算-Trampoline,say NO to StackOverflowError详解编程语言
- what is the difference of select single and select up to one row in abap详解编程语言
- MySQL 5.6: Bringing High Performance to the Table(mysql5.6)
- How to Install and Configure TGTD in Linux for Powerful Storage Management(linuxtgtd)
- Linux TGZ: All You Need to Know About Tar and Gzip Compression!(linuxtgz)
- Exploring the Benefits of Oracle Share: A Guide to Collaboration and File Sharing.(oracleshare)
- Exploring the World of Linux with Ease: A Guide to Using Aoyou(遨游forlinux)
- Exploring the Possibilities: Using Linux to Connect and Control HDMI Inputs(linuxhdmi输入)
- How to Fix MYSQL Error 1239 and Keep Your Database Running Smoothly(mysql1239)
- How to Lift the Linux Curse: Tips and Tricks for Better System Management(linuxcurse)
- 10 Simple Steps to Modify MySQL and Improve Database Performance(modifymysql)
- MySQL中的AND和OR使用逻辑运算符优化查询语句(mysql中and与or)