EXPERIMENT-1.
1 DATE-
21ST AUG,2025
AIM : - Write a C-program for Print your name and
address (Take User Input)
FLOWCHART :-
THEORY : -
• #include <stdio.h>
tells the compiler to include the standard
input/output file.
• printf() ;
printf() in C is a standard library function used to
print formatted output to the screen .
SYNTAX: printf(“format_string”,arguments) Where
“format_string” means contains text .
• fgets() ;
gets() in C is a standard library function used to
safely read a line of text (string) from input, including
spaces, until a newline (\n) or a given size limit.
SYNTAX: char*fgets (char*string,file name*stream) n
means maximum number of charcters to read .
• scanf();
scanf() in C is a standard library function used to take
formatted input from the user through the keyboard.
SYNTAX:scanf(“format_string”,&variable1,&variable2..);
CODE :-
#include <stdio.h>
int main() {
char name[20];
char address[30];
printf(“enter your name : ”);
scanf("%s",name);
scanf("%s",address);
printf(“enter your address : ”);
printf("your name is %s & your address is
%s",name,address);
return 0;
}
OUTPUT :-
CONCLUSION :-
We learnt about vast cases of printf() ,
scanf() ,fgets() command in different
scenarios.