BCA Sem 1 C Programming Guide – Important Programs & Questions (With Solutions)
Ankit Singh
13 June 2026· BCA Study Guides

C Programming ko "Mother of all Programming Languages" kaha jaata hai. Agar aapka C foundation strong hai, toh aage ke semesters ke subjects (jaise C++, Java, Data Structures) bahut easy ho jaate hain. Is guide mein hum BCA Sem 1 C Programming ke sabhi important programs, theory questions, aur practical exam tips cover karenge.
📑 Table of Contents
- 👉 Why C Programming is Important
- 👉 C Programming Important Theory Questions
- 👉 Top 20 C Programs with Solutions
- 👉 Control Flow Programs
- 👉 Array Programs
- 👉 String Programs
- 👉 Function Programs
- 👉 Structure Programs
- 👉 File Handling Programs
- 👉 Exam Tips – How to Score Full Marks
- 👉 Frequently Asked Questions (FAQs)
🚀 Quick Access – Direct Download Links
| 📄 All BCA Sem 1 Papers (Complete Bundle) | Download Now → |
| 💻 C Programming Papers (BCA-102) | Download Now → |
| 🔥 BCA Sem 1 Important Questions 2026 | Read Guide → |
| 📄 BCA Sem 1 Previous Year Papers | Read Guide → |
| 📚 BCA Sem 1 Subjects List | Read Guide → |
| 📘 BCA Sem 1 Complete Study Guide | Read Guide → |
| 📅 VNSGU Time Table 2026 | Check Dates → |
💻 Why C Programming is Important
- Foundation Language – C++, Java, Python, JavaScript sab C se derive hui hain
- Logic Building – C aapko programming logic sikhata hai
- Career Growth – Agar C strong hai toh aage ke semesters easy ho jaate hain
- Exam Weightage – BCA Sem 1 mein C Programming ka weightage sabse zyada hai (30% paper)
📌 C Programming Important Theory Questions
Ye theory questions har saal VNSGU BCA Sem 1 exams mein aate hain.
Unit 1: Basics of C
- What is C Programming? Explain its features.
- Explain the structure of a C program.
- What are data types in C? Explain with examples.
- What are operators in C? Explain arithmetic, relational, logical operators.
- Explain input/output functions –
printfandscanfwith examples. - What is type casting? Explain with example.
Unit 2: Control Flow
- Explain if-else and switch statements with syntax and examples.
- Explain loops – for, while, do-while with examples.
- Explain break and continue statements with examples.
- What is the difference between while and do-while loop?
Unit 3: Arrays & Strings
- What is an array? Explain 1D and 2D arrays with examples.
- What is a string? Explain string functions –
strlen,strcpy,strcat,strcmp. - Explain the relationship between arrays and pointers.
Unit 4: Functions
- What is a function? Explain function declaration, definition, and calling.
- Difference between call by value and call by reference with examples.
- What is recursion? Explain with example.
- Explain storage classes – auto, register, static, extern.
Unit 5: Pointers
- What is a pointer? Explain pointer declaration and initialization.
- Explain pointer arithmetic with example.
- Explain the relationship between arrays and pointers.
Unit 6: Structures
- What is a structure? How to define and access structure members?
- Explain nested structures with example.
- What is the difference between structure and array?
🔥 Top 20 C Programs with Solutions
Yeh programs 80% exams mein aate hain. Har program ko paper par likhkar practice karo.
📝 Control Flow Programs
Program 1: Fibonacci Series
#include <stdio.h>
int main() {
int n, a=0, b=1, c;
printf("Enter number of terms: ");
scanf("%d", &n);
printf("Fibonacci Series: %d %d ", a, b);
for(int i=2; i<n; i++) {
c = a + b;
printf("%d ", c);
a = b;
b = c;
}
return 0;
}
Output: Enter number of terms: 5 → Fibonacci Series: 0 1 1 2 3
Program 2: Factorial using Loop
#include <stdio.h>
int main() {
int n, fact=1;
printf("Enter a number: ");
scanf("%d", &n);
for(int i=1; i<=n; i++) {
fact = fact * i;
}
printf("Factorial of %d is %d", n, fact);
return 0;
}
Output: Enter a number: 5 → Factorial of 5 is 120
Program 3: Prime Number Check
#include <stdio.h>
int main() {
int n, flag=0;
printf("Enter a number: ");
scanf("%d", &n);
for(int i=2; i<=n/2; i++) {
if(n%i == 0) {
flag = 1;
break;
}
}
if(flag == 0)
printf("%d is Prime Number", n);
else
printf("%d is Not Prime", n);
return 0;
}
Output: Enter a number: 7 → 7 is Prime Number
Program 4: Reverse a Number
#include <stdio.h>
int main() {
int n, rev=0, rem;
printf("Enter a number: ");
scanf("%d", &n);
while(n != 0) {
rem = n % 10;
rev = rev * 10 + rem;
n = n / 10;
}
printf("Reversed Number: %d", rev);
return 0;
}
Output: Enter a number: 12345 → Reversed Number: 54321
📊 Array Programs
Program 5: Find Largest Element in Array
#include <stdio.h>
int main() {
int arr[100], n, largest;
printf("Enter number of elements: ");
scanf("%d", &n);
printf("Enter %d elements: ", n);
for(int i=0; i<n; i++) {
scanf("%d", &arr[i]);
}
largest = arr[0];
for(int i=1; i<n; i++) {
if(arr[i] > largest) {
largest = arr[i];
}
}
printf("Largest Element: %d", largest);
return 0;
}
Program 6: Bubble Sort
#include <stdio.h>
int main() {
int arr[100], n, temp;
printf("Enter number of elements: ");
scanf("%d", &n);
printf("Enter %d elements: ", n);
for(int i=0; i<n; i++) {
scanf("%d", &arr[i]);
}
for(int i=0; i<n-1; i++) {
for(int j=0; j<n-i-1; j++) {
if(arr[j] > arr[j+1]) {
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}
printf("Sorted Array: ");
for(int i=0; i<n; i++) {
printf("%d ", arr[i]);
}
return 0;
}
Program 7: Matrix Addition
#include <stdio.h>
int main() {
int a[10][10], b[10][10], sum[10][10], r, c;
printf("Enter rows and columns: ");
scanf("%d %d", &r, &c);
printf("Enter first matrix:
");
for(int i=0; i<r; i++) {
for(int j=0; j<c; j++) {
scanf("%d", &a[i][j]);
}
}
printf("Enter second matrix:
");
for(int i=0; i<r; i++) {
for(int j=0; j<c; j++) {
scanf("%d", &b[i][j]);
}
}
printf("Sum Matrix:
");
for(int i=0; i<r; i++) {
for(int j=0; j<c; j++) {
sum[i][j] = a[i][j] + b[i][j];
printf("%d ", sum[i][j]);
}
printf("
");
}
return 0;
}
🔤 String Programs
Program 8: Palindrome String Check
#include <stdio.h>
#include <string.h>
int main() {
char str[100];
int len, flag=0;
printf("Enter a string: ");
gets(str);
len = strlen(str);
for(int i=0; i<len/2; i++) {
if(str[i] != str[len-i-1]) {
flag = 1;
break;
}
}
if(flag == 0)
printf("%s is Palindrome", str);
else
printf("%s is Not Palindrome", str);
return 0;
}
Output: Enter a string: MADAM → MADAM is Palindrome
Program 9: Reverse a String
#include <stdio.h>
#include <string.h>
int main() {
char str[100], rev[100];
int len;
printf("Enter a string: ");
gets(str);
len = strlen(str);
for(int i=0; i<len; i++) {
rev[i] = str[len-i-1];
}
rev[len] = ' ';
printf("Reversed String: %s", rev);
return 0;
}
Output: Enter a string: HELLO → Reversed String: OLLEH
Program 10: Count Vowels and Consonants
#include <stdio.h>
#include <string.h>
int main() {
char str[100];
int vowels=0, consonants=0;
printf("Enter a string: ");
gets(str);
for(int i=0; i<strlen(str); i++) {
char ch = str[i];
if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u' ||
ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U') {
vowels++;
} else if((ch>='a' && ch<='z') || (ch>='A' && ch<='Z')) {
consonants++;
}
}
printf("Vowels: %d
Consonants: %d", vowels, consonants);
return 0;
}
⚙️ Function Programs
Program 11: Factorial using Recursion
#include <stdio.h>
int factorial(int n) {
if(n == 0)
return 1;
else
return n * factorial(n-1);
}
int main() {
int n;
printf("Enter a number: ");
scanf("%d", &n);
printf("Factorial: %d", factorial(n));
return 0;
}
Output: Enter a number: 5 → Factorial: 120
Program 12: Fibonacci using Recursion
#include <stdio.h>
int fib(int n) {
if(n <= 1)
return n;
else
return fib(n-1) + fib(n-2);
}
int main() {
int n;
printf("Enter number of terms: ");
scanf("%d", &n);
for(int i=0; i<n; i++) {
printf("%d ", fib(i));
}
return 0;
}
Output: 0 1 1 2 3 5 8 13 ...
Program 13: Swap Numbers (Call by Reference)
#include <stdio.h>
void swap(int *a, int *b) {
int temp;
temp = *a;
*a = *b;
*b = temp;
}
int main() {
int x=10, y=20;
printf("Before Swap: x=%d, y=%d
", x, y);
swap(&x, &y);
printf("After Swap: x=%d, y=%d", x, y);
return 0;
}
Output: Before Swap: x=10, y=20 → After Swap: x=20, y=10
🏗️ Structure Programs
Program 14: Student Details using Structure
#include <stdio.h>
struct student {
int roll;
char name[50];
float marks;
};
int main() {
struct student s;
printf("Enter Roll Number: ");
scanf("%d", &s.roll);
printf("Enter Name: ");
scanf(" %[^
]", s.name);
printf("Enter Marks: ");
scanf("%f", &s.marks);
printf("
Student Details:
");
printf("Roll: %d
Name: %s
Marks: %.2f", s.roll, s.name, s.marks);
return 0;
}
Program 15: Array of Structures
#include <stdio.h>
struct employee {
int id;
char name[50];
float salary;
};
int main() {
struct employee emp[3];
for(int i=0; i<3; i++) {
printf("Enter Employee %d ID: ", i+1);
scanf("%d", &emp[i].id);
printf("Enter Name: ");
scanf(" %[^
]", emp[i].name);
printf("Enter Salary: ");
scanf("%f", &emp[i].salary);
}
printf("
--- Employee Details ---
");
for(int i=0; i<3; i++) {
printf("ID: %d | Name: %s | Salary: %.2f
",
emp[i].id, emp[i].name, emp[i].salary);
}
return 0;
}
📂 File Handling Programs
Program 16: Write to File using fprintf
#include <stdio.h>
int main() {
FILE *fp;
char data[100];
fp = fopen("student.txt", "w");
if(fp == NULL) {
printf("File not created");
return 0;
}
printf("Enter data: ");
scanf(" %[^
]", data);
fprintf(fp, "%s", data);
fclose(fp);
printf("Data written successfully.");
return 0;
}
Program 17: Read from File using fscanf
#include <stdio.h>
int main() {
FILE *fp;
char data[100];
fp = fopen("student.txt", "r");
if(fp == NULL) {
printf("File not found");
return 0;
}
fscanf(fp, "%[^
]", data);
printf("Data from file: %s", data);
fclose(fp);
return 0;
}
Program 18: Linear Search
#include <stdio.h>
int main() {
int arr[100], n, key, found=0;
printf("Enter number of elements: ");
scanf("%d", &n);
printf("Enter %d elements: ", n);
for(int i=0; i<n; i++) {
scanf("%d", &arr[i]);
}
printf("Enter element to search: ");
scanf("%d", &key);
for(int i=0; i<n; i++) {
if(arr[i] == key) {
printf("Element found at position %d", i+1);
found = 1;
break;
}
}
if(found == 0)
printf("Element not found");
return 0;
}
🎯 Exam Tips – How to Score Full Marks in C Programming
- 📝 Algorithm likho → 2 marks milte hain
- 📊 Flowchart banao → 2 marks milte hain
- 💻 Program likho → 4-5 marks milte hain
- 🖥️ Sample output dikhao → 1 mark milta hai
- Total → 9-10 marks
- Not writing algorithm – Algorithm se 2 marks milte hain. Skip mat karo.
- Forgetting semicolons – Syntax errors ke liye marks kat te hain.
- Wrong loop condition – Program logic mein mistake hoti hai.
- Not handling edge cases – Zero, negative values handle karo.
- Not practicing on paper – Exam mein computer nahi milega. Paper par practice karo.
❓ Frequently Asked Questions
Fibonacci series, Factorial (recursion), Palindrome string, Bubble sort, Matrix addition – ye 5 programs har saal aate hain.
Practice programs on paper, memorize syntax, solve previous year papers. Focus on arrays, functions, strings, and recursion.
C Programming paper has 70 marks. 30 marks internal + 70 marks external.
28/70 in external exam and 40/100 overall.
Arrays, Functions (recursion, call by reference), Strings (palindrome, reverse), and Control Flow (loops, if-else).
📌 Related Resources
Download subject-wise guide with solved programs.
Download 2019-2025 papers for all subjects – free PDFs.
Complete syllabus, exam pattern, and marks distribution.
How to pass on first attempt – study plan & exam strategies.
Check your BCA exam dates and download timetable PDF.
Step-by-step guide to submit forms, fees, and deadlines.
Keep reading more exam guides
All Blog Posts