Structure and Union
In this function, We will learn to use gets function in the c programming language. To understand this example, You must have knowledge of the following topics.
Learn C programming directly from mobile. This app includes tutorials with topics, examples and live compiler.
Her are some facts you must now about the scanf() and gets().
This is the algorithm to use gets function
Step 1: Start
Step 2: Initialize array variable of size 50
Step 3: Use gets() function and pass initialized variable as parameter
Step 4: Print String variable
Step 5: End
This is the flowchart to use gets() functions in effective way
Now, Let’s look an code to understand how to use gets() in c programming language.
// char array of size 50
printf("Enter your full name:\n");
printf("\nYour Name is : %s", str);
The output of above program is
Enter your full name:
Your Name is : Suresh chand
Get the latest tutorials, examples and projects updates.
Ads Blocker Detected!!!
We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.
Disable Ad Block
Want Same System