You are here : cpp0scanf

scanf() - 0

To Take User Input from Console.


Syntax

int scanf(const char *format, ...)


Example

#include <stdio.h>

int main()
{
   char str1[20], str2[30];

   printf("Enter name: ");
   scanf("%s", &str1);

   printf("Enter your website name: ");
   scanf("%s", &str2);

   printf("Entered Name: %s", str1);
   printf("Entered Website:%s", str2);
   
   return(0);
}


Output / Return Value

output


Limitations


Alternatives / See Also


Reference

tutorialspoint.com