Picture this: you write a fantastic program, but it sits silently, not talking to anyone. Useless, right? Input and output (I/O) functions turn your code into something alive — they help it listen, respond, and engage. This is why if you're taking a C Programming Course in Noida, you'll see I/O functions drilled into your brain from day one.


scanf()can handle integers, floats, characters, and strings. It’s like your all-in-one Swiss knife.
int age;
float salary;
char name[50];
printf("Enter your age: ");
scanf("%d", &age);
printf("Enter your monthly salary: ");
scanf("%f", &salary);
printf("Enter your name: ");
scanf("%s", name);
printf("Age: %d, Salary: %.2f, Name: %s\n", age, salary, name);
But watch out — scanf()stops reading a string at the first whitespace. To get a full line, you’ll want fgets().
When you need to read entire lines or multi-word strings,fgets()saves you.
char bio[100];
printf("Write a short bio: ");
fgets(bio, sizeof(bio), stdin);
printf("Your bio: %s", bio);
getchar()reads a single character. Handy for “Press any key” pauses or menu choices.
char option;
printf("Press any key to continue: ");
option = getchar();
printf("You pressed: %c\n", option);
getch()(from conio.h) doesn’t wait for Enter, but it’s compiler-dependent.
printf() is everywhere. Whether you want to debug or show final output, you’ll rely on it.
printf("Hello, world!\n");
printf("Total: %d\n", total);
printf("Percentage: %.2f%%\n", percent);
puts() prints a string and adds a newline.
puts("Welcome to the C Programming Course in Noida!");
Prints a single character.
putchar('N');
putchar('\n');
#include
int main() {
char name[50];
int roll;
float marks1, marks2, marks3, total, avg;
printf("Enter name: ");
scanf("%s", name);
printf("Enter roll number: ");
scanf("%d", &roll);
printf("Enter marks in three subjects: ");
scanf("%f %f %f", &marks1, &marks2, &marks3);
total = marks1 + marks2 + marks3;
avg = total / 3;
printf("\n--- Report Card ---\n");
printf("Name: %s\n", name);
printf("Roll: %d\n", roll);
printf("Total: %.2f\n", total);
printf("Average: %.2f\n", avg);
return 0;
}
#include
int main() {
char item[20];
int quantity;
float price, total;
printf("Enter item name: ");
scanf("%s", item);
printf("Enter quantity: ");
scanf("%d", &quantity);
printf("Enter price per item: ");
scanf("%f", &price);
total = quantity * price;
printf("\nItem: %s\n", item);
printf("Quantity: %d\n", quantity);
printf("Total Bill: %.2f\n", total);
return 0;
}
#include
int main() {
char name[30], city[30];
int age;
printf("Enter your name: ");
fgets(name, sizeof(name), stdin);
printf("Enter your city: ");
fgets(city, sizeof(city), stdin);
printf("Enter your age: ");
scanf("%d", &age);
printf("\n--- Info Sheet ---\n");
printf("Name: %s", name);
printf("City: %s", city);
printf("Age: %d\n", age);
return 0;
}
Think about it: no matter how advanced your logic is, without good I/O, your code is mute. You’ll be using these to build quizzes, file readers, online forms, games, and more. If you truly want to master input output functions in C, practice them until they feel like second nature.
Once you’re solid on console I/O, you’ll soon step into file handling. Imagine writing data to a file or reading config files — same principle, but for permanent storage. Then there’s formatted output, dynamic string handling, and advanced buffer management.
If you nail these I/O basics, the rest of C feels a lot less intimidating. Use them creatively: make a small chatbot, a quiz game, or a daily planner. The possibilities are endless.
Stick with your C Programming Course in Noida, play around, and watch your skills grow. Because in the end, code that can talk is code that lives.
Keep exploring, keep asking, and keep writing code that speaks back.
Personalized learning paths with interactive materials and progress tracking for optimal learning experience.
Explore LMSCreate professional, ATS-optimized resumes tailored for tech roles with intelligent suggestions.
Build ResumeDetailed analysis of how your resume performs in Applicant Tracking Systems with actionable insights.
Check ResumeAI analyzes your code for efficiency, best practices, and bugs with instant feedback.
Try Code ReviewPractice coding in 20+ languages with our cloud-based compiler that works on any device.
Start Coding
TRENDING
BESTSELLER
BESTSELLER
TRENDING
HOT
BESTSELLER
HOT
BESTSELLER
BESTSELLER
HOT
POPULAR