Answers for "how to use scanf"

0

scanf()

#include <stdio.h>
int main() {
   // using scanf() 
   int user_input;
   
   printf("Please enter a number: ");
   scanf("%d", &user_input);
   printf("You entered: %d", user_input);

   return 0;
}
Posted by: Guest on October-21-2021
0

c++ how to use scanf

#include <stdio.h>

int main()
{
    int a, b, c;
    printf("Enter the first value:");
    scanf("%d", &a);
    printf("Enter the second value:");
    scanf("%d", &b);
    c = a + b;
    printf("%d + %d = %d\n", a, b, c);
    return 0;
}
Posted by: Guest on May-11-2020

Browse Popular Code Answers by Language