simple c program keeps crashing

前端 未结 2 1671
礼貌的吻别
礼貌的吻别 2021-01-25 13:50
#include 
int main(void)
{
int a,b,c;
printf(\"Enter values of a,b,c:\");
scanf(\"%d %d %d\",a,b,c);

printf(\"\\nDescending order of the numbers entered:         


        
2条回答
  •  心在旅途
    2021-01-25 14:05

    That's because you are not passing the address of your variables to scanf. Change

    scanf("%d %d %d",a,b,c) 
    

    to

    scanf("%d %d %d",&a,&b,&c)
    

提交回复
热议问题