Phone:+91-88823 09876

Amity Solved Assignment of C Programming

Body: 

C Programming (OBC 103)

Assignment A

1. What is the basic difference between DVORAK and QWERTY pattern of keyboards? Explain in the context of current market usage.

2. Differentiate between compiler and interpreter

3. Differentiate between compiler and interpreter

4. What do you understand by output device? Explain printer and printing mechanism of character by dot matrix.

5. With the help of a ‘C’ program define call by value and call by reference.

6. What are the different storage classes available in ‘c’? Explain any one of them.

7. What is operator? Define conditional operator with a C program.

8. Write a function that receives 5 integers and returns the sum and the average of these numbers. Call this function from main () and print the results in main ().

9. Write a c Program to count number of characters, number of blanks, and number of words.

 

Assignment B

 

Section B - Case Study

QUESTION 1

 

A 5 digit positive integer is entered through the keyboard, write a function to calculate sum of digits of the 5 digit number:

a)     Without using recursion

b)     Using recursion

 

QUESTION 2

 

Write a recursive function to obtain the first 25 numbers of a Fibonacci sequence. In a Fibonacci sequence the sum of two successive terms gives the third term.

Following are the first few terms of the Fibonacci sequence:

1   1   2   3   5    8   13   21   34   55   89…..

 

 

Assignment C

 

QUESTION 1

 

Which of the following is not a valid variable name declaration?

                       

  1. int _a3;

 

  1. int a_3;

 

  1. int 3_a;

 

  1. int _3a

 

QUESTION 2

 

Which of the following cannot be checked in a switch-case statement?

                       

  1. Character

 

  1. Integer

 

  1. float

 

  1. enum

 

QUESTION 3

 

What is the problem in following variable declaration?

                       

  1. The variable name begins with an integer

 

  1. The special character -

 

  1. The special character?

 

  1. All of the mentioned

 

QUESTION 4

 

Which data type is most suitable for storing a number 65000 in a 32-bit system?

                       

  1. signed short

 

  1. unsigned short

 

  1. long

 

  1. int

 

QUESTION 5

 

Which of the following is not a unary operators in C?

                       

  1. !

 

  1. sizeof

 

  1. ~

 

  1. &&

 

QUESTION 6

 

enum types are processed by

                       

  1. Compiler

 

  1. Preprocessor

 

  1. Linker

 

  1. Assembler

 

QUESTION 7

 

Who is father of C Language?

                       

  1. Bjarne Stroustrup

 

  1. James A. Gosling

 

  1. Dennis Ritchie

 

  1. Dr. E.F. Codd

 

QUESTION 8

 

Which is more memory efficient?

                       

  1. structure

 

  1. union

 

  1. both use same memory

 

  1. depends on a programmer

 

QUESTION 9

 

Which variables cannot be declared?

                       

  1. Structure

 

  1. Pointer

 

  1. Class

 

  1. void

 

QUESTION 10

 

& means?

                       

  1. Logical OR

 

  1. Bitwise OR

 

  1. Logical AND

 

  1. Bitwise AND

 

QUESTION 11

 

Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3) ?

                       

  1. Variable

 

  1. Function

 

  1. typedef

 

  1. macros

 

QUESTION 12

 

Which of the data types have size that is variable?

                       

  1. int

 

  1. struct

 

  1. float

 

  1. double

 

QUESTION 13

 

Which of the following declaration is not supported by C?

                       

  1. String str;

 

  1. char *str;

 

  1. float str = 3e2;

 

  1. Both (a) and (c)

 

QUESTION 14

 

Which of the following is not a pointer declaration?

                       

  1. char a[10];

 

  1. "char a[] = { 1 , 2 , 3 , 4 };"

 

  1. char *str;

 

  1. char a;

 

QUESTION 15

 

"When double is converted to float, the value is?"

                       

  1. Truncated

 

  1. Rounded

 

  1. Depends on the compiler

 

  1. Depends on the standard

 

QUESTION 16

 

What is the correct value to return to the operating system upon the successful completion of a program?

                       

  1. 1

 

  1. -1

 

  1. 0

 

  1. Program do not return a value

 

QUESTION 17

 

"Find the output of the following program. void main() { int i=01289; printf(""%d"", i); }"

                       

  1. 289

 

  1. 1289

 

  1. 713

 

  1. syntax error

 

QUESTION 18

 

The precedence of arithmetic operators is (from highest to lowest)

                       

  1. "%, *, /, +, "

 

  1. "%, +, /, *, "

 

  1. "+, -, %, *, /"

 

  1. "%, +, -, *, /"

 

QUESTION 19

 

Which of the following data type will throw an error on modulus operation(%)?

                       

  1. char

 

  1. short

 

  1. int

 

  1. float

 

QUESTION 20

 

Which type conversion is NOT accepted?

                       

  1. From char to int

 

  1. From float to char pointer

 

  1. From negative int to char

 

  1. From double to char

 

QUESTION 21

 

"For which of the following, PI++; code will fail?"

                       

  1. #define PI 3.14

 

  1. char *PI = A ;

 

  1. float PI = 3.14;

 

  1. None of the Mentioned

 

QUESTION 22

 

What is the output of this C code? #include void main() { 1 < 2 ? return 1: return 2; }

                       

  1. returns 1

 

  1. returns 2

 

  1. Varies

 

  1. Compile time error

 

QUESTION 23

 

"What is the type of the below assignment expression if x is of type float, y is of type int? y = x + y;"

                       

  1. int

 

  1. float

 

  1. There is no type for an assignment expression

 

  1. double

 

QUESTION 24

 

"For initialization a = 2, c = 1 the value of a and c after this code will be c = (c) ? a = 0 : 2;"

                       

  1. "a = 0, c = 0;"

 

  1. "a = 2, c = 2;"

 

  1. "a = 2, c = 2;"

 

  1. "a = 1, c = 2;"

 

QUESTION 25

 

"What is the output of this C code? #include void main() { char a = 'A'; char b = 'B'; int c = a + b % 3 - 3 * 2; printf(""%d\n"", c); }"

                       

  1. 65

 

  1. 58

 

  1. 64

 

  1. 59

 

QUESTION 26

 

Which of the following operator has the highest precedence in the following?

                       

  1. ()

 

  1. sizeof

 

  1. *

 

  1. +

 

QUESTION 27

 

Switch statement accepts?

                       

  1. int

 

  1. char

 

  1. long

 

  1. All of the mentioned

 

QUESTION 28

 

Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3) ?

                       

  1. Variable

 

  1. Function

 

  1. macros

 

  1. typedef

 

QUESTION 29

 

Which of the following is an invalid if-else statement?

                       

  1. if (if (a == 1)){}

 

  1. if (func1 (a)){}

 

  1. if (a){}

 

  1. if ((char) a){}

 

QUESTION 30

 

Which keyword can be used for coming out of recursion?

                       

  1. break

 

  1. return

 

  1. exit

 

  1. Both (a) and (b)

 

QUESTION 31

 

Which keyword is used to come out of a loop only for that iteration?

                       

  1. break

 

  1. continue

 

  1. return

 

  1. None of the mentioned

 

QUESTION 32

 

goto can be used to jump from main to within a function

                       

  1. TRUE

 

  1. false

 

  1. Depends

 

  1. Varies

 

QUESTION 33

 

The value obtained in the function is given back to main by using ________ keyword?

                       

  1. return

 

  1. static

 

  1. new

 

  1. volatile

 

QUESTION 34

 

What is the problem in the following declarations? int func(int); double func(int); int func(float);

                       

  1. A function with same name cannot have different signatures

 

  1. A function with same name cannot have different return types

 

  1. A function with same name cannot have different number of parameters

 

  1. All of the mentioned

 

QUESTION 35

 

What is the scope of an external variable?

                       

  1. Whole source file in which it is defined

 

  1. From the point of declaration to the end of the file in which it is defined

 

  1. Any source file in a program

 

  1. From the point of declaration to the end of the file being compiled

 

QUESTION 36

 

Which of the following cannot be static in C?

                       

  1. Variables

 

  1. Functions

 

  1. Structures

 

  1. None of the mentioned

 

QUESTION 37

 

Property which allows to produce different executable for different platforms in C is called?

                       

  1. File inclusion

 

  1. Selective inclusion

 

  1. Conditional compilation

 

  1. Recursive macros

 

QUESTION 38

 

A preprocessor is a program

                       

  1. That processes its input data to produce output that is used as input to another program

 

  1. That is nothing but a loader

 

  1. That links various source files

 

  1. All of the mentioned

 

QUESTION 39

 

"Comment on the following pointer declaration? int *ptr, p;"

                       

  1. "ptr is a pointer to integer, p is not"

 

  1. "ptr and p, both are pointers to integer"

 

  1. "ptr is a pointer to integer, p may or may not be"

 

  1. ptr and p both are not pointers to integer

10 points   Save Answer

QUESTION 40

 

What is prototype of a function in C

                       

  1. It is the return type of a function

 

  1. It is the return data of the function

 

  1. It is declaration of a function

 

  1. It is a datatype

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Title:
Amity Solved Assignment of C Programming (With Online Typing & Filling)
Short Name or Subject Code:  C Programming
Short Description:  Solution will be visible instantly after successful payment of amount
University:  Amity
Service Type:  Assignments
Select Semester:  Semester- I Select Cource:  B.C.A
commerce line item type: 
Price: 
₹800.00
Product: