Answers for "c scanf with string"

C
-1

scanf in c

#include <stdio.h>
int main()
{
//Notice, that we have used &testInteger inside scanf(). 
//It is because &testInteger gets the address of testInteger, 
//and the value entered by the user is stored in that address.
    int testInteger;
    printf("Enter an integer: ");
    scanf("%d", &testInteger);  
    printf("Number = %d",testInteger);
    return 0;
}
Posted by: Guest on March-01-2022

Code answers related to "C"

Browse Popular Code Answers by Language