0% found this document useful (0 votes)
12 views8 pages

June 22 S

The document outlines the scheme of evaluation and answer key for the APJ Abdul Kalam Technological University B.Tech degree examination in Programming in C, held in June 2022. It includes a detailed breakdown of marks for various questions across two parts, covering topics such as ALU and CU functions, flowcharts, data types, and file handling functions. Additionally, it provides example programs and explanations for concepts like recursion, pointers, and string handling.

Uploaded by

matrix29v
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

June 22 S

The document outlines the scheme of evaluation and answer key for the APJ Abdul Kalam Technological University B.Tech degree examination in Programming in C, held in June 2022. It includes a detailed breakdown of marks for various questions across two parts, covering topics such as ALU and CU functions, flowcharts, data types, and file handling functions. Additionally, it provides example programs and explanations for concepts like recursion, pointers, and string handling.

Uploaded by

matrix29v
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

0100EST102052003

Scheme of Valuation/Answer Key


(Scheme of evaluation (marks in brackets) and answers of problems/key)
APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY
SECOND SEMESTER B.TECH DEGREE EXAMINATION(2019 SCHEME), JUNE 2022
Course Code: EST 102
Course Name: PROGRAMMING IN C (Common to all programs)
Max. Marks: 100 Duration: 3 Hours
PART A
Answer all Questions. Each question carries 3 Marks Marks
1 ALU function – 1.5 marks (3)
CU function – 1.5 marks.
2 Correct flowchart- 3 marks (3)
3 Syntax-1+1=2marks (3)
Entry controlled and exit controlled-1 mark
4 Explanation- 3 marks (3)
C is a highly structured language. The goto statement is discouraged in C, because it alters the sequential
flow of logic that is the characteristic of C language. Also it makes difficult to trace program flow control.
5 1. #include <stdio.h> (3)
2. #include<string.h>
3. int main()
4. {
5. char str1[20]; // declaration of char array
6. char str2[20]; // declaration of char array

Downloaded from Ktunotes.in


0100EST102052003

7. int value; // declaration of integer variable


8. printf("Enter the first string : ");
9. scanf("%s",str1);
10. printf("Enter the second string : ");
11. scanf("%s",str2);
12. // comparing both the strings using strcmp() function
13. value=strcmp(str1,str2);
14. if(value==0)
15. printf("strings are same");
16. else
17. printf("strings are not same");
18. return 0;
19. }

6 Correct Program- 3 marks (3)


#include <stdio.h>
int main()
{
int array[100], size, c, location = 0;
printf("Enter the number of elements in array\n");
scanf("%d", &size);
printf("Enter %d integers\n", size);
for (c = 0; c < size; c++)
scanf("%d", &array[c]);
for (c = 1; c < size; c++)
if (array[c] > array[location])
location = c;

Downloaded from Ktunotes.in


0100EST102052003

printf("Maximum element is present at location %d and its value is %d.\n", location+1, array[location]);
return 0;
}

7 Call by value & example- 1.5 marks (3)


Call by reference & example – 1.5 marks
8 Any two advantages 1.5 marks each (3)
Code reusability, avoid redundancy, manageability, Improves collaboration
9 Text mode- 1.5 marks (3)
Binary mode- 1.5 marks
10 Pointer-1.5 marks (3)
Initialisation-1.5 marks
PART B
Answer any one Question from each module. Each question carries 14 Marks
11 a) Explanation with example-4 marks (14)
Flowchart-4 marks
Pseudocode-6 marks
OR
12 a) Registers-1 Mark (6)
five important registers in CPU along with functions (5 marks)
b) Correct Algorithm- 7 marks (8)
Sample:
1. Input a Number
2. Initialize Sum to zero

Downloaded from Ktunotes.in


0100EST102052003

3. While Number is not zero


4. Get Remainder by Number Mod 10
5. Add Remainder to Sum
6. Divide Number by 10
7. Print sum

13 a) Any 4 data types with explanation - 4 marks. Memory requirements- 3 marks. (7)
int or signed int-2bytes
Integers are whole numbers that can have both zero, positive and negative values but no decimal values.
Float -4 bytes
Float and double are used to hold real numbers. The floating-point data type allows the user to type decimal
values. For example, average marks can be 97.665. if we use int data type, it will strip off the decimal part
and print only 97. To print the exact value, we need ‘float’ data type.
Char-1 byte
char stores a single character. Char consists of a single byte.
Double-8 bytes
Double is 8 bytes, which means you can have more precision than float. This is useful in scientific programs
that require precision. Float is just a single-precision data type; double is the double-precision data type.
Size given is compiler /os specific.....Eg: int is 4 bytes in gcc linux and mark must be given
b) Correct Program- 7 marks (7)

OR
14 a) formatted I/O functions with example-3.5 marks (7)
Unformatted I/O functions with example-3.5 marks

Downloaded from Ktunotes.in


0100EST102052003

b) Correct Program- 7 marks (7)


15 a) Correct program-7 Marks (7)
#include <stdio.h>

int main()
{
int m, n, c, d, matrix[10][10], transpose[10][10];
printf("Enter the number of rows and columns of a matrix\n");
scanf("%d%d", &m, &n);
printf("Enter elements of the matrix\n");

for (c = 0; c < m; c++)


for (d = 0; d < n; d++)
scanf("%d", &matrix[c][d]);

for (c = 0; c < m; c++)


for (d = 0; d < n; d++)
transpose[d][c] = matrix[c][d];

printf("Transpose of the matrix:\n");

for (c = 0; c < n; c++)


{
for (d = 0; d < m; d++)
printf("%d\t", transpose[c][d]);
printf("\n");
}
return 0;
}

b) 4 string handling functions along with Syntax -7 marks (7)

Downloaded from Ktunotes.in


0100EST102052003

OR
16 a) Correct program-7 Marks (7)

#include <stdio.h>
#include <string.h>

int main()
{
char Str[100], RevStr[100];
int i, j, len;

printf("\n Please Enter any String : ");


gets(Str);

j = 0;
len = strlen(Str);

for (i = len - 1; i >= 0; i--)


{
RevStr[j++] = Str[i];
}
RevStr[i] = '\0';

printf("\n String after Reversing = %s", RevStr);

return 0;
}

b) Correct Program- 7 marks (7)


17 a) Structure Creation -3Marks (7)

Downloaded from Ktunotes.in


0100EST102052003

Function to read data- 2 Marks


Function to display data- 2 Marks.
b) Storage class definition -1 mark. (7)
Any 3 storage classes (Auto, extern, static, register)- 1 mark each.
Example – 1 Mark each
OR
18 a) Differences-3 marks (7)
Situation -2 marks
Example- 2 marks
b) Recursion- 1 mark (7)
Correct Program- 6 marks
19 a) Correct Program- 7 marks (7)
b) Explanation with a sample program- 7 marks (7)
OR
20 a) Any 5 file handling functions with syntax-7 marks (7)
fopen()
fgets()
fprintf()
fclose()
fseek()

Downloaded from Ktunotes.in


0100EST102052003

b) Correct Program- 7 marks (7)


#include <stdio.h>
void main()
{
int n, i, arr1[15];
int *pt;
printf("\n\n Pointer : Print the elements of an array in reverse order :\n");
printf(" Input the number of elements to store in the array (max 15) : ");
scanf("%d",&n);
pt = &arr1[0];
printf(" Input %d number of elements in the array : \n",n);
for(i=0;i<n;i++)
{
printf(" element - %d : ",i+1);
scanf("%d",pt);
pt++;
}

pt = &arr1[n - 1];

printf("\n The elements of array in reverse order are :");

for (i = n; i > 0; i--)


{
printf("\n element - %d : %d ", i, *pt);
pt--;
}
printf("\n\n");
}
NOTE: Marks may be awarded for programs conveying correct logic.
Sample programs are included in scheme.

Downloaded from Ktunotes.in

You might also like