Curioustab Logo
Curioustab
Aptitude Reasoning CS GK Civil Past Papers
Free Test
Log in Sign up
Menu
Aptitude Reasoning CS GK Past Papers Free Test
Popular Topics
Time and Work Percentage Ratio & Proportion Simple Interest Number Series Analogy Indian History General Science
Explore
About Contact
Log in Sign up
  1. Home
  2. /
  3. C Programming
  4. /
  5. Input / Output

Input / Output Questions

Practice Input / Output MCQs with answers and explanations. Page 2 of 2.

Take a Free Test Browse Topics
Category
C Programming
Topic
Input / Output
Page
2 / 2
Mode
Practice

Questions

Open any question to view the answer and explanation.

All Topics
C file I/O with fseek and fgets: if source.txt contains the single line "Be my friend", what does this program print? #include<stdio.h> int main() { FILE *fs; char c[10]; fs = fopen("source.txt", "r"); c[0] = getc(fs); // read 'B' fseek(fs, 0, SEEK_END); // go to end of file fseek(fs, -3L, SEEK_CUR); // back up 3 bytes fgets(c, 5, fs); // read up to 4 chars into c puts(c); return 0; }
Open
View answer
Self-referential format (a classic quine-style string): what exact output does this program produce? #include<stdio.h> char *str = "char *str = %c%s%c; main(){ printf(str, 34, str, 34);}"; int main() { printf(str, 34, str, 34); return 0; }
Open
View answer
Understanding printf escapes: how many % signs are printed here? #include<stdio.h> int main() { printf("%%%% "); return 0; }
Open
View answer
Prev 12

Practice smarter

Solve a few questions daily and revisit weak topics regularly to improve accuracy.

Take a Test Browse topics
Curioustab Logo Curioustab
Practice smarter. Improve faster.
Aptitude
  • Time and Work
  • Percentage
  • Ratio & Proportion
  • Simple Interest
  • Average
  • Compound Interest
Reasoning
  • Blood Relation
  • Course of Action
  • Number Series
  • Analogy
  • Coding Decoding
  • Logical Deduction
General Knowledge
  • Indian History
  • Indian Geography
  • Famous Personalities
  • General Science
  • Indian Politics
  • Sports
Explore
  • About
  • Contact
  • Sitemap
  • Privacy Policy
  • Terms of Service

© 2026 Curioustab.com — All rights reserved.

Built for exam practice, speed, and clarity.