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
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();
}