SlideShare a Scribd company logo
Programming in c
Scheme of Examination
Sample Question Paper
Sample Solution with :
Algorithm
Flowchat
Source Code
Output
Max. Marks : 100 Duration : 3 Hours
Marks Distribution
Program 1 - 20 Marks
Program 2 - 20 Marks
Program 3 - 20 Marks
Viva - 25 Marks
[Pra.Copy + IR] – 15 Marks
Total - 100 Marks
Set : A
Note : (i)Attempt any 3 Questions.
(ii) All program with flowchart & algorithms.
Qu. 1: Write a program to print the following:
A
A B
A B C
Qu. 2: Write a program to find the factorial of a given number.
Qu. 3: Write a program to use putw() & getw() in file
handling.
Qu. 4: Write a program of Command Line Argument.
Set : A
Qu. 2: Write a program to find the factorial of a given number.
Algorithm : To find factorial of a number.
Step 1: [Take input for variable num]
num=value
Step 2 : [Initialization]
fact = 1, i = num
Step 3 : Repeat step 3 while (i>=1)
i) fact = fact*I
ii) i = i-1
Step 4 : [Display the value of fact]
Print “Factorial is : ” fact
Step 5 : Exit
START
Take Input for
num
Initialize
fact = 1
i = num
i>=1
fact = fact * i
i=i-1
Print “Factorial
is ” fact
STOP
False
True
// A program to find the factorial of a number. Documentation Section
#include<stdio.h> // Header files ….. Link Section
#include<conio.h>
void main() // main function section
{
int num,i,fact=1; // variable declaration & initialization
clrscr(); // clear screen
printf(“Enter any positive no. : ”);
scanf(“%d”,&num);
i = num; //Logic to get factorial no. starts from here
while(I >= 1)
{
fact = fact * i;
i--;
} // Logic ends here
printf(“Factorial of %d is %d”,num,fact);
getch();
}
Enter any positive no. : 5
Factorial of 5 is 120
Programming in c
Programming in c

More Related Content

What's hot (19)

PPTX
Lecture 3 time complexity
Abirami A
 
PDF
P3
lksoo
 
DOCX
electic mashinary fundamentals 5th edition Lab tasks stack
Muhammad Nasir
 
DOCX
PYTHON PROGRAMS
Alvino rock
 
PPTX
Sequential multiplication
Taqwa It Center
 
PDF
Java -lec-5
Zubair Khalid
 
PPTX
CS 151 homework2a
Rudy Martinez
 
PDF
Mastering Arrays Assignment
Kasun Ranga Wijeweera
 
PPTX
Insert element position
Kavya Shree
 
DOCX
Practical no 4
Kshitija Dalvi
 
PPTX
3.3 the math object
allenbailey
 
PDF
A story about my journey in the land of programming practices
Raphael Meyer
 
PPTX
C coding#1
Sekhar Pisini
 
PPTX
Easy practice with current timemillis method
Nooria Esmaelzade
 
PPTX
3.2 stacks and arrays
allenbailey
 
DOCX
Bti1022 lab sheet 9 10
alish sha
 
PPTX
Pa1 wednesday flow_chart
aiclub_slides
 
PPTX
Adding A Dash In jQuery:
Reema
 
PPTX
Deletion of an element at a given particular position
Kavya Shree
 
Lecture 3 time complexity
Abirami A
 
P3
lksoo
 
electic mashinary fundamentals 5th edition Lab tasks stack
Muhammad Nasir
 
PYTHON PROGRAMS
Alvino rock
 
Sequential multiplication
Taqwa It Center
 
Java -lec-5
Zubair Khalid
 
CS 151 homework2a
Rudy Martinez
 
Mastering Arrays Assignment
Kasun Ranga Wijeweera
 
Insert element position
Kavya Shree
 
Practical no 4
Kshitija Dalvi
 
3.3 the math object
allenbailey
 
A story about my journey in the land of programming practices
Raphael Meyer
 
C coding#1
Sekhar Pisini
 
Easy practice with current timemillis method
Nooria Esmaelzade
 
3.2 stacks and arrays
allenbailey
 
Bti1022 lab sheet 9 10
alish sha
 
Pa1 wednesday flow_chart
aiclub_slides
 
Adding A Dash In jQuery:
Reema
 
Deletion of an element at a given particular position
Kavya Shree
 

Viewers also liked (10)

PPTX
Über The Team Enablers
Sarah Hoeter
 
PPTX
(061) 822 8592 / 0822 7499 9994 Aqiqah Medan Nurul Hayat
Aqiqah Medan Nurul Hayat
 
PPT
المذكرات
muaz mustafa
 
PPTX
Cooperative Learning
Jolieto Cambalo Caparida
 
PDF
Werk is Waar u bent. Een White Paper von Leitz.
Staples Advantage Europe
 
PPTX
Los procedimientos-de-distribución-y-distribución-a-prorrata
Leudis Castillo González
 
PDF
Mars7 - Интернет решения
Mars7
 
DOCX
Ahmad cv 1
Ahmad Alulaimi
 
DOCX
Ahmad Hamdan CV
Ahmad Hamdan
 
PPTX
Valoración de la planificación y del trabajo en
Adri Pombo González
 
Über The Team Enablers
Sarah Hoeter
 
(061) 822 8592 / 0822 7499 9994 Aqiqah Medan Nurul Hayat
Aqiqah Medan Nurul Hayat
 
المذكرات
muaz mustafa
 
Cooperative Learning
Jolieto Cambalo Caparida
 
Werk is Waar u bent. Een White Paper von Leitz.
Staples Advantage Europe
 
Los procedimientos-de-distribución-y-distribución-a-prorrata
Leudis Castillo González
 
Mars7 - Интернет решения
Mars7
 
Ahmad cv 1
Ahmad Alulaimi
 
Ahmad Hamdan CV
Ahmad Hamdan
 
Valoración de la planificación y del trabajo en
Adri Pombo González
 
Ad

Similar to Programming in c (20)

PPTX
Simple program recursion problem solving.pptx
swethab129
 
PPTX
CSE 115 l project
Mohin Ibn Mohammad
 
PDF
Chapter 5 exercises Balagurusamy Programming ANSI in c
BUBT
 
PDF
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
rohit kumar
 
PPTX
Ak different patterns in algorithms
Abhishek Kumar
 
PDF
25422733 c-programming-and-data-structures-lab-manual
kamesh dagia
 
PDF
C++ TUTORIAL 4
Farhan Ab Rahman
 
PPT
algorithm_practice.pptzkkxiqdhiwdowhdohwod2hodh2odh2o
3107aloksingh
 
PDF
import java.util.Scanner;public class Factorial { method usi.pdf
aptind
 
PDF
PSP LAB MANUAL.pdf
Selvaraj Seerangan
 
PDF
programs
Vishnu V
 
PPTX
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
PPTX
FUNCTIONAL REQ 2.pptx
OmprakashChandrakar3
 
PPTX
Introduction to Internet of things Introduction to Internet of things
sharada3
 
PDF
Algorithm Design: Optimization using recursion.
Ferry Kemperman
 
DOCX
Java Practice Set
Gaurav Dixit
 
PDF
algorithm
Divya Ravindran
 
PPTX
Problem Solving - Introduction to Flowcharts.pptx
aroojtmalik
 
PPTX
Csci101 lect03 algorithms_i
Elsayed Hemayed
 
DOCX
Conditional structure
International Islamic University
 
Simple program recursion problem solving.pptx
swethab129
 
CSE 115 l project
Mohin Ibn Mohammad
 
Chapter 5 exercises Balagurusamy Programming ANSI in c
BUBT
 
Let us c(by Yashwant Kanetkar) 5th edition solution chapter 1
rohit kumar
 
Ak different patterns in algorithms
Abhishek Kumar
 
25422733 c-programming-and-data-structures-lab-manual
kamesh dagia
 
C++ TUTORIAL 4
Farhan Ab Rahman
 
algorithm_practice.pptzkkxiqdhiwdowhdohwod2hodh2odh2o
3107aloksingh
 
import java.util.Scanner;public class Factorial { method usi.pdf
aptind
 
PSP LAB MANUAL.pdf
Selvaraj Seerangan
 
programs
Vishnu V
 
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
SaraswathiRamalingam
 
FUNCTIONAL REQ 2.pptx
OmprakashChandrakar3
 
Introduction to Internet of things Introduction to Internet of things
sharada3
 
Algorithm Design: Optimization using recursion.
Ferry Kemperman
 
Java Practice Set
Gaurav Dixit
 
algorithm
Divya Ravindran
 
Problem Solving - Introduction to Flowcharts.pptx
aroojtmalik
 
Csci101 lect03 algorithms_i
Elsayed Hemayed
 
Conditional structure
International Islamic University
 
Ad

More from CS_GDRCST (6)

PPTX
Java package
CS_GDRCST
 
PPTX
Exam tips
CS_GDRCST
 
PPT
Ds new
CS_GDRCST
 
PPT
Computer Organization and Architecture.
CS_GDRCST
 
PPT
Computer Networks basics and OSI
CS_GDRCST
 
PPTX
INTRODUCTION TO DATABASE
CS_GDRCST
 
Java package
CS_GDRCST
 
Exam tips
CS_GDRCST
 
Ds new
CS_GDRCST
 
Computer Organization and Architecture.
CS_GDRCST
 
Computer Networks basics and OSI
CS_GDRCST
 
INTRODUCTION TO DATABASE
CS_GDRCST
 

Recently uploaded (20)

PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
community health nursing question paper 2.pdf
Prince kumar
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 

Programming in c

  • 2. Scheme of Examination Sample Question Paper Sample Solution with : Algorithm Flowchat Source Code Output
  • 3. Max. Marks : 100 Duration : 3 Hours Marks Distribution Program 1 - 20 Marks Program 2 - 20 Marks Program 3 - 20 Marks Viva - 25 Marks [Pra.Copy + IR] – 15 Marks Total - 100 Marks
  • 4. Set : A Note : (i)Attempt any 3 Questions. (ii) All program with flowchart & algorithms. Qu. 1: Write a program to print the following: A A B A B C Qu. 2: Write a program to find the factorial of a given number. Qu. 3: Write a program to use putw() & getw() in file handling. Qu. 4: Write a program of Command Line Argument.
  • 5. Set : A Qu. 2: Write a program to find the factorial of a given number. Algorithm : To find factorial of a number. Step 1: [Take input for variable num] num=value Step 2 : [Initialization] fact = 1, i = num Step 3 : Repeat step 3 while (i>=1) i) fact = fact*I ii) i = i-1 Step 4 : [Display the value of fact] Print “Factorial is : ” fact Step 5 : Exit
  • 6. START Take Input for num Initialize fact = 1 i = num i>=1 fact = fact * i i=i-1 Print “Factorial is ” fact STOP False True
  • 7. // A program to find the factorial of a number. Documentation Section #include<stdio.h> // Header files ….. Link Section #include<conio.h> void main() // main function section { int num,i,fact=1; // variable declaration & initialization clrscr(); // clear screen printf(“Enter any positive no. : ”); scanf(“%d”,&num); i = num; //Logic to get factorial no. starts from here while(I >= 1) { fact = fact * i; i--; } // Logic ends here printf(“Factorial of %d is %d”,num,fact); getch(); }
  • 8. Enter any positive no. : 5 Factorial of 5 is 120