Is it better to declare and initialize the variable or just declare it? What's the best and the most efficient way?
For example, I have this code:
#include <stdio.h>
int main()
{
int number = 0;
printf("Enter with a number: ");
scanf("%d", &number);
if(number < 0)
number= -number;
printf("The modulo is: %d\n", number);
return 0;
}
If I don't initialize number
, the code works fine, but I want to know, is it faster, better, more efficient? Is it good to initialize the variable?