添加程序C显示错误的输出 [英] Add program C is showing wrong output

查看:66
本文介绍了添加程序C显示错误的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include<stdio.h>
#include<math.h>
int main()
{
	int a,b,c;
	printf("Enter two number to add \n");
	scanf("%d %d", &a, &b);
	c = a+b;
	printf("The addition of a and b is  %d", &c );
	return 0;
}





< ----- 2 + 3出来2293316 ---->



我尝试过:



将VOID更改为Int。当我将其更改为VOID时,它显示错误,我应该将其更改为int。



<-----Out for 2+3 is coming 2293316 ---->

What I have tried:

Changed VOID to Int. When I change it to VOID then it is showing me error that i should change it to int.

推荐答案

printf("The addition of a and b is  %d", c );





printf需要一个值而不是指针。



printf requires a value and not pointer.


这篇关于添加程序C显示错误的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆