C
Q. Which format specifier is used to read and print the string using printf() and scanf() in C?
- Correct Answer - Option(D)
- Views: 243
- Filed under category C Programming
C
The format specifier "%s" is used to read and print the string using printf() and scanf() in C. Example: #include <stdio.h> int main() { char name[30]; printf("Input name: "); scanf("%s", name); printf("Given name is: %s", name); return 0; } /* Output: Input name: Alvin Given name is: Alvin */
You must be Logged in to update hint/solution
Discusssion
Login to discuss.