0% found this document useful (0 votes)
50 views4 pages

C Programming Experiment 1.1

The document outlines an experiment aimed at writing a C program to print a user's name and address based on user input. It includes a brief theory section explaining the functions printf(), fgets(), and scanf() used in the program. The provided code demonstrates how to implement these functions to gather and display user information.

Uploaded by

Lakshay Jindal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views4 pages

C Programming Experiment 1.1

The document outlines an experiment aimed at writing a C program to print a user's name and address based on user input. It includes a brief theory section explaining the functions printf(), fgets(), and scanf() used in the program. The provided code demonstrates how to implement these functions to gather and display user information.

Uploaded by

Lakshay Jindal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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.

You might also like