Programming in C (CSIT140)-Semester I
We Also Provide SYNOPSIS AND PROJECT.
Contact www.kimsharma.co.in for best and lowest cost solution or
Email: amitymbaassignment@gmail.com
Call/what’s app: +91 8290772200
What’s app: +91 8800352777
Amity assignment solution help, Amity assignment answers help, Assignment Help
1st Module Assessment
Question 1
Which of the following component is known as the Brain of computer?
Select one:
a. Screen
b. Mouse
c. Keyboard
d. CPU
Question 2
__is the non-tangible part that tells the computer how to do its job.
Select one:
a. HARDWARE
b. SOFTWARE
c. PEOPLEWARE
d. Firmware
Question 3
ROM stands for
Select one:
a. Read Record memory
b. Read only memory
c. record memory
d. Read write memory
Question 4
Which of the following enables the application software to interact with the computer hardware?
Select one:
a. Operating Software
b. System Software
c. Device software
d. Utility Software
Question 5
Which of the following is non-volatile memory?
Select one:
a. SRAM
b. DRAM
c. All of the mentioned
d. ROM
Question 6
Which of the following is the name of a special program that makes your computer carry out a task?
Select one:
a. Software
b. Hardware
c. Data
d. COMMAND
Question 7
____ is the tangible part of a computer system.
Select one:
a. SOFTWARE
b. Firmware
c. HARDWARE
d. PEOPLEWARE
Question 8
Which of the following is a collection of independent and unorganized facts?
Select one:
a. Output
b. DATA
c. Input
d. Process
Question 9
Which of the following is the processed and organized data presented in a meaningful form?
Select one:
a. Process
b. Output
c. INFORMATION
d. DATA
Question 10
Sequence of 8 bits is known as
Select one:
a. None of the mentioned
b. Value
c. BYTE
d. WORD
Which of the following takes one or more object files generated by a compiler and combines them into one, executable program?
Select one:
a. Assembler
b. Interpreter
c. Linker
d. Loader
Question 11
_______ is the part of an operating system that is responsible for loading programs and libraries
Select one:
a. Assembler
b. Linker
c. Interpreter
d. Loader
Question 12
_______ is a program that converts low level language into machine level language.
Select one:
a. Interpreter
b. Linker
c. Compiler
d. Assembler
Question 13
________converts source code into intermediate code and then this intermediate code is executed line by line.
Select one:
a. Assembler
b. Interpreter
c. Linker
d. Compiler
Question 14
Which of the following transforms source language into object language ?
Select one:
a. Assembler
b. Linker
c. Interpreter
d. Compiler
Question 15
Which of the following operating system does not support multitasking?
Select one:
a. Linux
b. Unix
c. Windows 10
d. MS DOS
Question 16
A 32-bit system can access _______ of RAM
Select one:
a. 4 GB
b. 8 GB
c. 6 GB
d. 12 GB
Question 17
Which of the following is not an operating system?
Select one:
a. Pocket PC
b. KaiOS
c. Tizen
d. Slack
We Also Provide SYNOPSIS AND PROJECT.
Contact www.kimsharma.co.in for best and lowest cost solution or
Email: amitymbaassignment@gmail.com
Call/what’s app: +91 8290772200
What’s app: +91 8800352777
Amity assignment solution help, Amity assignment answers help, Assignment Help
2nd Module Assessment
Question 1
c Language is
Select one:
a. Assembly language
b. Machine dependent
c. Machine independent
d. Low level language
Question 2
Which of the following data type represents the absence of type?
Select one:
a. int
b. string
c. Void
d. double
Question 3
Who has developed C Programming Language?
Select one:
a. Dennis Ritchie
b. Guido van Rossum
c. Linus Torvalds
d. Issac Netwon
Question 4
An ___ is a symbol that instructs the compiler to perform specific mathematical or logical functions
Select one:
a. design
b. Comparator
c. Operator
d. prototype
Question 5
Which of the following data type is a single octet(one byte)?
Select one:
a. char
b. float
c. double
d. int
Question 6
Which of the following is known as Logical OR Operator?
Select one:
a. &&
b. !
c. ~
d. ||
Question 7
C programming language was developed in
Select one:
a. Intel Labs
b. AT & T Labs
c. Bell Labs
d. IBM Lab
Question 8
stdio.h specifies
Select one:
a. core input and output functions
b. several useful types and macros
c. precise width integer types
d. string handling functions
Question 9
What is the formal string for Scan or print an integer as signed decimal number?
Select one:
a. %d
b. %f
c. %c
d. %s
Question 10
A header file is a file with extension ____which comprises C function declarations and macro definitions to be shared between several source files
Select one:
a. .w
b. .h
c. .t
d. .y
Question 11
Which of the following function is utilized to read the values stored in various variables and store these values in a character array?
Select one:
a. scanf()
b. printf()
c. sprint()
d. sscanf()
Question 12
Which of the following function is utilized to read the characters from a string and stores them in variables?
Select one:
a. sscanf()
b. printf()
c. sprint()
d. scanf()
Question 13
Which of the following function is utilized to read one or multiple inputs from the user at the console?
Select one:
a. printf()
b. sscanf()
c. sprint()
d. scanf()
Question 14
What is the formal string for Scan or print a floating point number?
Select one:
a. %d
b. %c
c. %f
d. %s
Question 15
What is the output of the following code snippet? #include <stdio.h>
int main()
{
int a = 7, c;
c = a;
printf(“c = %d\n”, c);
return 0;
}
Select one:
a. 7
b. 5
c. 4
d. 9
Question 16
What is the output of the following code snippet? #include <stdio.h>
int main()
{
int a = 10, b = 100;
printf(“++a = %d \n”, ++a);
return 0;
}
Select one:
a. 11
b. 15
c. 9
d. 12
Question 17
What is the output of the following code snippet? #include <stdio.h>
int main()
{
int a = 10, b = 100;
printf(“++a = %d \n”, ++a);
return 0;
}
Select one:
a. 101
b. 10
c. 11
d. 100
30/30
We Also Provide SYNOPSIS AND PROJECT.
Contact www.kimsharma.co.in for best and lowest cost solution or
Email: amitymbaassignment@gmail.com
Call/what’s app: +91 8290772200
What’s app: +91 8800352777
Amity assignment solution help, Amity assignment answers help, Assignment Help
3rd Module Assessment
Question 1
Which statement is used when a sequence of decision is required?
Select one:
a. for
b. switch
c. Nested if-else
d. while
Question 2
Which of the following statement comprises of if, if else and switch statement ?
Select one:
a. Selection Statement
b. Expression Statement
c. Labeled statement
d. Compound Statement
Question 3
Which of the following storage class is defined as static specifier can hold their value between the multiple function calls?
Select one:
a. Automatic
b. External
c. static
d. Register
Question 4
Which of the following statement for loop, while loop and do while loop?
Select one:
a. Selection Statement
b. Jump statement
c. Labeled statement
d. Iteration Statement
Question 5
Which of the following storage class is is used to tell the compiler that the variable defined as extern is declared with an external linkage elsewhere in the program?
Select one:
a. Register
b. static
c. Automatic
d. External
Question 6
In which statement, an identifier followed by : (colon) is a label?
Select one:
a. Selection Statement
b. Compound Statement
c. Expression Statement
d. Labeled statement
Question 7
A _____statement permits a variable to be tested against numerous values for equality
Select one:
a. switch
b. while
c. for
d. Nested if-else
Question 8
A ____ implements the sequence of statements several times until the stated condition becomes false
Select one:
a. Loop
b. design
c. None of the mentioned
d. decision
Question 9
________consists of an expression followed by ; (semi colon)
Select one:
a. Labeled statement
b. Compound Statement
c. Selection Statement
d. Expression Statement
Question 10
Which of the following is termed as an exit-controlled loop?
Select one:
a. do-while loop
b. while loop
c. for loop
d. switch
Question 11
argc refers to
Select one:
a. pointer array which points to every single argument passed to the program
b. list of functions
c. number of arguments passed
d. None of the mentioned
Question 12
Pre-processor directives commence with a ____symbol
Select one:
a. hash(#)
b. asterisk(*)
c. modulo(%)
d. ampersand(&)
Question 13
argv[] refers to
Select one:
a. number of arguments passed
b. Argument Vector
c. list of functions
d. None of the mentioned
Question 14
______ processes program prior to going to the compiler
Select one:
a. Selection statements
b. printf() function
c. scanf() function
d. Pre-processor
Question 15
What is the output of the following code snippet? #include<stdio.h>
int main()
{
int n;
for(n = 9; n!=0; n–)
printf(“n = %d”, n–);
getchar();
return 0;
}
Select one:
a. Above program goes in infinite loop because n is never zero when loop condition (n != 0) is checked.
b. n=7 6 5 4 3 2 1
c. n=6 5 4 3 2 1
d. Garbage Value
Question 16
What is the output of the following code snippet? #include<stdio.h>
main()
{
int x = 5;
if(x==5)
{
if(x==5) break;
printf(“program”);
}
printf(“computer”);
}
Select one:
a. Compile Error
b. program
c. computer
d. programcomputer
Question 17
What is the output of the following code snippet? #include<stdio.h>
int main()
{
int i;
while(0, i < 2)
{
printf(“Loop “);
i++;
}
return 0;
}
Select one:
a. 0
b. Loop
c. Loop Loop
d. Compile error
30/30
We Also Provide SYNOPSIS AND PROJECT.
Contact www.kimsharma.co.in for best and lowest cost solution or
Email: amitymbaassignment@gmail.com
Call/what’s app: +91 8290772200
What’s app: +91 8800352777
Amity assignment solution help, Amity assignment answers help, Assignment Help
4th Module Assessment
Question 1
A function may send back a value is known as
Select one:
a. Function Name
b. Parameter
c. Function Body
d. Return Type
Question 2
Which of the following method copies the actual value of an argument into the formal parameter of the function?
Select one:
a. Return Type
b. Call by Value
c. Call by reference
d. Parameter
Question 3
Which of the following method duplicates the address of an argument into the formal parameter?
Select one:
a. Return Type
b. Call by Value
c. Parameter
d. Call by reference
Question 4
The ______encompasses a collection of statements that describe what the function does.
Select one:
a. Function Name
b. Function Body
c. Return Type
d. Parameter
Question 5
For which reason, functions are used?
Select one:
a. All of the mentioned
b. To enhance the readability of code
c. Decreases the size of the code, identical set of statements are substituted by function calls.
d. Debugging of the code would be simpler if you use functions, as errors are uncomplicated to be traced.
Question 6
A _______is a cluster of statements that together accomplish a task
Select one:
a. Structure
b. Pointer
c. function
d. Union
Question 7
Which of the following is the correct declaration of Array?
Which of the following is the correct declaration of Array?
Select one:
a. int num[100]
b. int [100]
c. int num=100
d. None of the mentioned
Question 8
An _______is a assemblage of one or more values of the identical type
Select one:
a. Union
b. Structure
c. array
d. Pointer
Question 9
Which of the following is organized as matrices which can be exemplified as the collection of rows and columns?
Select one:
a. 1D Array
b. Union
c. 2D Array
d. Structure
Question 10
A _____ is like a placeholder
Select one:
a. Return Type
b. Parameter
c. Function Name
d. Function Body
C Program_______
Select one:
a. None of the above
b. must contain atleast one function
c. Needs input data
d. Need not contain any function
Question 11
What will be the output of the following code? #include”stdio.h”
void main()
{
int a[20];
printf(“%d %d”, a[11], a[18]);
}
Select one:
a. Garbage value 0
b. Code will not compile
c. Garbage value Garbage Value
d. 0 0
Question 12
What is right way to Initialize array?
Select one:
a. int n{5} = { 7, 4, 6 };
b. int num[5] = { 7, 4, 2, 5, 6 };
c. int n(6) = { 7, 4, 2, 5, 6 };
d. int n{} = { 7, 4, 2, 5, 6 };
Question 13
What will be printed after execution of the following code? void main()
{
int arr[8] = {5,6,7,8,9};
printf(“%d”, arr[6]);
}
Select one:
a. 6
b. 9
c. 0
d. 5
Question 14
Which of the following is the correct syntax for storing word “COMPUTER” in C programming?
Select one:
a. char name[8] = {‘C’,’O’,’M’,’P’,’U’,’T’,’E’,’R’,’\0′}
b. char name[8] = {‘C’,’O’,’M’,’P’,’U’,’T’,’E’,’R’}
c. name = “COMPUTER”
d. char name[8] = {“C”,”O”,”M”,”P”,”U”,”T”,”E”,”R”}
Question 15
Which of the following keyword is used to transfer control from a function back to the calling function?
Select one:
a. switch
b. goto
c. Break
d. return
Question 16
Assume y be an array. Which of the following operations are incorrect?
I. ++y
II. y+1
III. y++
IV. y*2
Select one:
a. I and II
b. II and III
c. I, II and III
d. I, III and IV
Question 17
What will be the output of the program ?
#include”stdio.h”
int main()
{
int arr[10] = {100};
printf(“%d”, 10[arr]);
return 0;
}
Select one:
a. 100
b. 1
c. 16
d. 0
We Also Provide SYNOPSIS AND PROJECT.
Contact www.kimsharma.co.in for best and lowest cost solution or
Email: amitymbaassignment@gmail.com
Call/what’s app: +91 8290772200
What’s app: +91 8800352777
Amity assignment solution help, Amity assignment answers help, Assignment Help
5th Module Assessment
A set of simple string manipulation functions are employed in _______
<string.h>
Question 1
Which operator used to get value at address stored in a pointer variable?
Select one:
a. ||
b. &
c. *
d. &&
Question 2
Binary files are predominantly the ____ files in the computer.
Select one:
a. .bin
b. .cpp
c. .c
d. .txt
Question 3
Which of the library function is managed to compare two strings ?
Select one:
a. strcpy
b. strcmp
c. strcat
d. strlen
Question 4
An _______ is a block of sequential data
Select one:
a. pointer
b. Register
c. memory
d. array
Question 5
A _____is a variable that stores the address of another variable.
Select one:
a. Array
b. pointer
c. Register
d. memory
Question 6
Which of the library function concatenates a string onto the end of the new string?
Select one:
a. strcat
b. strlen
c. strcmp
d. strcpy
Question 7
_____ is the container well-defined in C to store data variables of different type and supports for the user defined variables storage
Select one:
a. Array
b. Structure
c. pointer
d. Union
Question 8
Members of a structure are always stored in —-
Select one:
a. Random memory locations
b. Different memory locations
c. consecutive memory locations
d. Alternate memory locations
Question 9
Which of the library function put back the length of a string?
Select one:
a. strcpy
b. strcat
c. strlen
d. strcmp
Question 10
Which of the library function is utilized to copy a string?
Select one:
a. strcpy
b. strcat
c. strlen
d. strcmp
A pointer is defined as
Select one:
a. All of the above
b. A variable that stores address of other variable
c. A variable that stores address of an instruction
d. A keyword used to create variables
Question 11
Which header file is used to defineNULL macro ?
Select one:
a. stdio.h
b. stddef.h
c. stdio.h and stddef.h
d. math.h
Question 12
Why do we use pointers in a C program?
Select one:
a. It enable complex “linked” data structures like linked lists and binary trees.
b. All of the above
c. It allows different functions to share and modify their local variables.
d. To pass large structures so that complete copy of the structure can be avoided.
Question 13
What is (void*)0?
Select one:
a. Representation of NULL pointer constant
b. Error
c. None of above
d. Representation of int pointer
Question 14
How can we merge two statements into one? char *ch; ch = (char*) malloc(100);
Select one:
a. char *ch = (char *)(malloc*)(100);
b. char ch = *malloc(100);
c. char *ch = (char*)malloc(100);
d. char *ch = (char) malloc(100);
Question 15
In this program float takes 4 bytes, what will be the output? #include <stdio.h>
int main()
{
float a[5] = {11.5, 10.0, 13.5, 90.5, 10.5};
float *x1 = &a[0];
float *x2 = x1 + 3;
printf(“%f “, *x2);
printf(“%d”, x2 – x1);
return 0;
}
Select one:
a. 90.500000 12
b. 90.500000 3
c. 10.000000 12
d. 0.500000 3
Question 16
What is the output of following program?
#include <stdio.h>
int main()
{
int i = 10;
void *p = &i;
printf(“%d\n”, (int)*p);
return 0;
}
Select one:
a. Run error
b. 20
c. 30
d. Compile error
Question 17
Output of following program? # include <stdio.h>
void pointer(int *z)
{
*z = 10;
}
int main()
{
int y = 20;
pointer(&y);
printf(“%d”, y);
return 0;
}
Select one:
a. Compile error
b. 20
c. Run error
d. 10
30/30
We Also Provide SYNOPSIS AND PROJECT.
Contact www.kimsharma.co.in for best and lowest cost solution or
Email: amitymbaassignment@gmail.com
Call/what’s app: +91 8290772200
What’s app: +91 8800352777
Amity assignment solution help, Amity assignment answers help, Assignment Help
Assignment 2
Case Study
Structures in C
A structure is a user-defined data type available in C that allows to combining data items of different kinds. Structures are used to represent a record.
Defining a structure: To define a structure, you must use the struct statement. The struct statement defines a new data type, with more than one member. The format of the struct statement is as follows:
struct [structure name]
{
member definition;
member definition;
…
member definition;
};
union
A union is a special data type available in C that allows storing different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple purposes.
Defining a Union: To define a union, you must use the union statement in the same way as you did while defining a structure. The union statement defines a new data type with more than one member for your program. The format of the union statement is as follows:
union [union name]
{
member definition;
member definition;
…
member definition;
};
Similarities between Structure and Union
Both are user-defined data types used to store data of different types as a single unit.
Their members can be objects of any type, including other structures and unions or arrays. A member can also consist of a bit field.
Both structures and unions support only assignment = and sizeof operators. The two structures or unions in the assignment must have the same members and member types.
A structure or a union can be passed by value to functions and returned by value by functions. The argument must have the same type as the function parameter. A structure or union is passed by value just like a scalar variable as a corresponding parameter.
‘.’ operator is used for accessing members.
Question 1 : In 32-bit system, find the size of the following structure in bytes
#include <stdio.h>
struct student
{
int b[10];
char ch;
};
Select one:
a. 41
b. 11
c. 44
d. 5
Question 2
Which of the following is not possible in C when members in a structure are same as that in a union?Let A be a structure and Let B be a union
Select one:
a. None of the above
b. sizeof(A) is greater than sizeof(B)
c. sizeof(A) is less than to sizeof(B)
d. sizeof(A) is equal to sizeof(B)
Question 3
Which of the following is not possible in C when members are different in a structure and union?Let A be a structure and Let B be a union
Select one:
a. sizeof(A) is greater than sizeof(B)
b. sizeof(A) is equal to sizeof(B)
c. None of the above
d. sizeof(A) is less than sizeof(B)
Question 4
What is the similarity between a structure, union and enumeration?
Select one:
a. All of them define new pointers
b. All of them define new structures
c. All of them define new values
d. All of them define new data types
Question 5
What will be the output of following program ? #include‹stdio.h›
int main()
{
struct student
{
char ch[] = “Godisgreat”;
int no_ofpages = 100;
};
struct student *p;
printf(“%d “, p->no_ofpages);
printf(“%s”, p->ch);
getchar();
return 0;
}
Select one:
a. 100 Godisgreat
b. 100
c. Compiler Error
d. 600
15/15
We Also Provide SYNOPSIS AND PROJECT.
Contact www.kimsharma.co.in for best and lowest cost solution or
Email: amitymbaassignment@gmail.com
Call/what’s app: +91 8290772200
What’s app: +91 8800352777
Amity assignment solution help, Amity assignment answers help, Assignment Help