MCS-011 Solved Assignment 2015-16 Ip
MCS-011 Solved Assignment 2015-16 Ip
MCS-011 Solved Assignment 2015-16 Ip
com
Course Code : MCS-011
Course Title : Problem Solving and Programming
Assignment Number : MCA(I)/011/Assignment/15-16
Maximum Marks : 100
Weightage : 25%
Last Dates for Submission : 15th October, 2015 (For July 2015 Session)
15th April, 2016 (For January 2016 Session)
1. Define a flowchart. Write an algorithm and draw a corresponding flowchart to create a simple
multiple choice question (MCQ) examination of 25 questions for 50 marks along with evaluation
process too. (20 Marks)
Ans : A flowchart is a type of diagram that represents an algorithm, workflow or process, showing the
steps as boxes of various kinds, and their order by connecting them with arrows. This diagrammatic
representation illustrates a solution model to a given problem. Flowcharts are used in analyzing,
designing, documenting or managing a process or program in various fields.
Flowcharts are used in designing and documenting simple processes or programs. Like other types of
diagrams, they help visualize what is going on and thereby help understand a process, and perhaps also
find flaws, bottlenecks, and other less-obvious features within it. There are many different types of
flowcharts, and each type has its own repertoire of boxes and notational conventions. The two most
common types of boxes in a flowchart are:
Page 1
Ignousolvedassignments.com
Nassi-Shneiderman diagrams and Drakon-charts are an alternative notation for process flow.
Common alternative names include: flowchart, process flowchart, functional flowchart, process map,
process chart, functional process chart, business process model, process model, process flow
diagram, work flow diagram, business flow diagram. The terms "flowchart" and "flow chart" are used
interchangeably.
The underlying graph structure of a flow chart is a flow graph, which abstracts away node types, their
contents and other ancillary information.
2. Compare and contrast the characteristics and/or organisation of the Write an interactive C
program for Q1. (10 Marks)
#include<stdio.h>
#include<conio.h>
main()
Thanks for visiting us!! Subscribe !!
Page 2
Ignousolvedassignments.com
{
char qs[][100]= {
{\n 1. In which state you stay at \n\t (1). Delhi (2). Outside Delhi},
{\n 2. Who is the CM of Delhi ? \n\t (1). Sheila Dixit (2). Arvind Kejriwal},
{\n 3. Grass is of which colour ? \n\t (1). Green (2). Black },
{\n 4. Duration of MCA is \n\t (1) 5years (2) 3Years},
{\n 5. IGNOU Head office is situated where in delhi},
};
int ans[] = {1,2,1,1,2};
int choice;
int score= 0, a=0, t;
for (a=0; a<5; a++)
{
clrscr();
puts(qs[a]);
printf(\n Enter the Answer (1 0r 2) \t\t\n);
scanf(%d, &choice);
if(ans[a]==choice)
score= score+1
if(a<4)
{
printf(\n Press enter to select next question...\n);
getch();
}
else
printf(\n The End \n);
}
printf(\n your total score is = %d, score);
getch();
}
Example
&
Operator
Page 3
Ignousolvedassignments.com
operand but not both.
0011 0001
<<
>>
Example
Try the following example to understand all the bitwise operators available in C programming
language:
#include <stdio.h>
main()
{
unsigned int a = 60;
unsigned int b = 13;
int c = 0;
c = a & b;
printf("Q1 - Value of c is %d\n", c );
c = a | b;
printf( Q2 - Value of c is %d\n", c );
c = a ^ b;
printf("Q3 - Value of c is %d\n", c );
Thanks for visiting us!! Subscribe !!
Page 4
Ignousolvedassignments.com
c = ~a;
printf("Q4 - Value of c is %d\n", c );
c = a << 2;
printf("Q5 - Value of c is %d\n", c );
c = a >> 2;
printf("Q6 - Value of c is %d\n", c );
}
When you compile and execute the above program it produces the following result:
Q1 - Value of c is 12
Q2 - Value of c is 61
Q3 - Value of c is 49
Q4 - Value of c is -61
Q5 - Value of c is 240
Q6 - Value of c is 15
4. Define an array. Write an interactive C program to take two single dimensional arrays of
integers and merge them into a single dimensional array, excluding the common elements of both
the arrays. (10 Marks)
C programming language provides a data structure called the array, which can store a fixed-size
sequential collection of elements of the same type. An array is used to store a collection of data, but it is
often more useful to think of an array as a collection of variables of the same type.
Instead of declaring individual variables, such as number0, number1, ..., and number99, you declare
one array variable such as numbers and use numbers[0], numbers[1], and ..., numbers[99] to represent
individual variables. A specific element in an array is accessed by an index.
All arrays consist of contiguous memory locations. The lowest address corresponds to the first element
and the highest address to the last element.
Page 5
Ignousolvedassignments.com
#include <stdio.h>
void merge(int [], int, int [], int, int []);
int main() {
int a[100], b[100], m, n, c, sorted[200];
printf("Input number of elements in first array\n");
scanf("%d", &m);
scanf("%d", &a[c]);
scanf("%d", &b[c]);
merge(a, m, b, n, sorted);
printf("Sorted array:\n");
{
printf("%d\n", sorted[c]);
return 0;
Page 6
Ignousolvedassignments.com
j = k = 0;
{
sorted[i] = a[j];
j++;
}
Else
sorted[i] = b[k];
k++;
}
i++;
}
else if (j == m) {
for (; i < m + n;)
}
else {
for (; i < m + n;)
sorted[i] = b[k];
k++;
i++;
sorted[i] = a[j];
j++;
i++;
Page 7
Ignousolvedassignments.com
area();
}
void area()
{
float area_circle;
float rad;
printf("\nEnter the radius : ");
scanf("%f",&rad);
area_circle = 3.14 * rad * rad ;
}
Output :
Enter the radius : 3
Area of Circle = 28.260000
// Prototype Declaration
//---------------------------------------void main()
{
float rad;
printf("nEnter the radius : ");
scanf("%f",&rad);
area(rad);
getch();
}
//---------------------------------------void area(float rad)
{
float ar;
ar = 3.14 * rad * rad ;
Page 8
Ignousolvedassignments.com
printf("Area of Circle = %f",ar);
}
Output :
Enter the radius : 3
Area of Circle = 28.260000
(iii) Function with arguments and with return value. (10 Marks)
#include<stdio.h>
float calculate_area(int);
int main()
{
int radius;
float area;
printf("\n Enter the radius of the circle : ");
scanf("%d",&radius);
area = calculate_area(radius);
printf("\nArea of Circle : %f ",area);
return(0);
}
float calculate_area(int radius)
{
float areaOfCircle;
areaOfCircle = 3.14 * radius * radius;
return(areaOfCircle);
}
Output :
Enter the radius of the circle : 2
Area of Circle : 12.56
6. Write an interactive C program to manage the assignments at study centres for the first
semester courses of MCA (MCS-011, 012, 13, 014, 015, MCSL-016 and MCSL-017). Maximum
marks for each assignment is 100 marks and weightage is 25%. Attending the viva-voce at the
study centre for each assignment is compulsory. Pass percentage in each assignment is 40%.
(Note: Use Structures concept).
Answer:
Page 9
Ignousolvedassignments.com
Page 10
Ignousolvedassignments.com
Page 11
Ignousolvedassignments.com
Page 12