I'm having a problem with nested loop c++ : I am a noobe in c++ ans I'm having problem with nested loops. Could you please help me and tell me where I'm mistaking

     main()
       {
	     int n, sum=0;
         printf("ENTER NUMBER:");
	     scanf("%i",n);
	    while(n>0)
	    {
	    	sum+=n;
	    	n--;
	    }
	     printf("\n sum is:",sum);
	     return 0;
    }

Thank you in advance.