I'm new on programming and I have started learning C language by my own. Although there is an issue on the following screenshot that I am not able to understand its logic. Specifically I don't know why C skips the part of scanf
in the called function. Does the order of calling matter? Thank you very much.
Here is the screenshot: https://i.stack.imgur.com/v7XTg.jpg
#include <stdio.h>
void GiveLetter(); // function prototype #1
void GiveNumber(); // function prototype #2
int main ()
{
int x;
printf("Give me the first number:");
scanf("%d",&x);
printf("Your first number is: %d\n",x);
printf("Hello Panos\n");
GiveLetter();
GiveNumber();
return 0;
}
void GiveLetter()
{
char Letter;
printf("Give a letter:\n");
scanf("%c",&Letter);
printf("Your letter is %c\n",Letter);
}
void GiveNumber()
{
int Number;
printf("Give the second number:");
scanf("%d",&Number);
printf("Your second number is %d\n",Number);
}