C--PROGRAM ALL QUESTIONS ANSWER
Question 1
Which one is a High Level Language
a) Assembly Language
b) Machine Language
c) Parser
d) C
Question 2
A programming language that provides little or no abstraction from a computer's
instruction set architecture
a) Low Level Language
b) High-Level Language
c) Interpreter
d) Browser
Question 3
In which year C language was developed ?
a) 1974
b) 1972
c) 1971
d) 1973
Question 4
Name of a memory location that we use for storing data whose values can be changed
a) Variables
b) static
c) constant
d) pointer
Question 5
Which of the following is not a type of computer programming language?
a) Natural Language
b) Machine Language
c) High-level Languages
d) Binary Languages
Question 6
The programming language that closely resembles the machine language is
a) High-level languages
b) C Language
c) FORTRAN
d) Assembly Language
Question 7
The tool used to convert a "C" program to machine language is called as
a) Linker
b) Language translator
c) Compiler
d) Preprocessor
Question 8
The programmer original program code is called as
a) Object file
b) Source file
c) Executable file
d) Application file
Question 9
The diagrammatic flow of the program is represented by
a) Flowchart
b) Program map
c) Pseudo code
d) Water fall mode
Question 10
C- language is
a) Assembly level Language
b) Low level Language
c) High level Language
d) All of above
Question 11
What is a program a) A set of instruction
b) A set of algorithem
c) A set of pseudo code
d) All of above
Question 12
Who developed the C language
a) Dennis Ritchie
b) Ken Thompson
c) Matrin Richards
d) Patric Naughton
Question 13
The C language has been developed at
a) AT & T Bell Labs
b) IBM
c) Borland International
d) Sun Microsystems
Question 14
Every statement in C program is to be terminated by a
a) dot(.)
b) semi-colon(;)
c) colon(:)
d) question mark(?)
Question 15
The escape sequence \b" is a
a) back space
b) next line
c) tab
d) none of the above
Question 16
Which OS (Operating System) supports C?
a) DOS only
b) Linux only c) Window only
d) All of the above
Question 17
A character variable can store how many characters at a time?
a) 1 character
b) 8 character
c) 255 character
d) None
Question 18
What will be stored in the variable "ch" if we write the statement char ch='z'?
a) ASCII value of Z
b) Z along with the single inverted commas
c) The character Z
d) None of above
Question 19
What is the maximum value that an signed integer constant can have?
a) 32768
b) 32767
c) 1.7014E+38
d) 256
Question 20
A variable name in C cannot start with?
a) a number
b) an alphabet
c) a capital charecter
d) None of above
Question 21
Which of the following statements is wrong?
a) int=123;
b) value=''+5
c) lime=20*'T'
d) count+5 result
Question 22
Which of the following statement is incorrect?
a) rem=3%2;
b) rem-3.14%2.1;
c) rem='a' % 'c'
d) None of above
Question 23
Which of the following special symbol allowed in an identifier?
a) *(asteric)
b) (underscore)
c) '-(hyphen)
d) (pipeline)
Question 24
Which will be the output of following program?
#include<stdio.h>
void main()
{
int i=20;
printf("%d\n", sizeof(i));
a) 2
b) 4
c) 20
d) None of above
Question 25
Which will be the output of following program?
#include<stdio.h>
void main()
{
int a;
printf("%d\n", a);
}
a) Error
b) 0
c) -1
d) Garbage Value
Question 26
Which will be the output of following program include <stdib.h>?
#include<stdio.h>
void main()
{int x = 10, y = 20, z = 5, i;
i = x<y,z;
printf("%d\n", i);
a) 0
b) 1
c) Error
d) None of Above
Question 27
Which of the following variable declaration is correct?
a) int length
b) char int
c) int long
d) All
Question 28
Which statement is correct for the comment used in C programming?
a) Comments are used to have some explanations in the programmers source code
b) only if a line begin with double slash, it is a comment
c) Comment decide the sequence of operations in the program
d) Comments must be outside the curly braces
Question 29
The preprocessor directive in? C? programming language begins with a) Hashsign(#)
b) Backslash and asterisk(/*)
c) Less than symbol
d) Two back shash(//)
Question 30
Every C program should compulsorily have a function called as:
a) start()
b) Start()
c) main()
d) Main()
Question 31
A block comments begins and ends with?
a) Start with / and end with //
b) Start with /* and end with */
c) Start with // and end with //
d) Start with < and end with >
Question 32
Which of the following cannot be used in identifiers?
a) Letters
b) Spaces
c) Underscore
d) Digits
Question 33
The difference between a and "a" is
a) The first one refers to a variable whose identifier is a and the second one refers to the character constant a
b) The first one is a character constant a and second one is the string literal a
c) Both are same
d) None of above
Question 34
Which of the following is not a valid escape code?
a) \t
b) lw
c) 11
d) \n
Question 35
const int width=100;
Regarding the above statement which of the statements is true?
a) Declares a variable width initialized as 100
b) Declares a construction with initialized as 100
c) Declares a integer type constant width with a fixed value of 100
d) Constructs an integer type variable with width a value 100
Question 36
For an assignment statement
a) The left side value of the assignment operator must always be a variable
b) The right side value of the assignment operator might be a constant, a variable, an expression or any combination of these
c) The assignment always takes place from right to left and never the other way d) All of above
Question 37
For the assignment statement :a=b;
Which of the following statement is true?
a) A check is done to compare the values of a and b
b) The value of b is assigned to variable a and any further changes in the program on variable b will also change the value of variable a
c) The value of b is assigned to variable a and any further changes in the program on variable b will not change the value of variable a
d) The value of b is assigned to variable b and any further changes in the program on variable a will not change the value of variable b
Question 38
Which of the following will not valid expressions in C?
a) a=2+(b=5);
b) a=b=c=5;
c) a=11%3
d) b+5=2
Question 39
Which of the following will not increase the value of variable c by 1?
a) c++;
b) c=c+1;
C) C+1>=c
d) c+=1
Question 40
When following code is executed, what will be the values of a and b?
b=3;
a=b++;
printf("\nb=%d",a);
printf("\na=%d",b);
a) a contains 3 and b contains 4
b) a contains 4 and b contains 4
c) a contains 4 and b contains 3
d) a contains 3 and b contains 3
Question 41
The result of relationai operator is always
a) either true or false
b) either less than or more than
c) either equal, less or more
d) None of above
Question 42
Which of the following is not a valid relational operator?
a)'==
b)'=>
c)'>=
d)<=
Question 43
The default standard output device for C programs is
a) Modem
b) Monitor
c) Disk
d) Printer
Question 44
The default standard input device for C++ program is
a) Mouse
b) Scanner
c) Keyboard
d) None of above
Question 45
When requesting multiple inputs from the user, they must be separated by
a) a space
b) a tab character
c) a new line character
d) any of the above
Question 46
The "return 0 "statement in main function indicates
a) The program did nothing i.e. completed zero tasks
b) The program will be executed without any error
c) The program has not yet completed the execution
d) None of the above
Question 47
What value must be returned to the operating system on the successful completion
of a program?
a) 0
b) -1
c) 1
d) Programs should not return a value
Question 48
What is the only function all programs must contain ?
a) start()
b) system()
c) main()
d) program()
Question 49
What is the function from where C programs begins their execution?
a) start()
b) begin()
c) main()
d) program()
Question 50
What punctuation is used to indicate the start and end of code blocks?
a) {and}
b) <and>
c) [and]
d) (and)
Question 51
Which of the following is the correct way of writing comments?
a) */comments/*
b) /*comment*/
c) **comment**
d) {comment}
Question 52
Which of the following is not a name of data type in C?
a) double
b) float
c) int
d) real
Question 53
Which relational operator is used for comparison?
a) :=
b) '==
c) equal
d)'=
Question 54
Which is the Boolean operator logical AND?
a) &
b) |
c) &&
d) ||
Question 55
Evaluate !(1 && !(0||1))
a) True
b) False
c) Error
d) Cannot be evaluated
Question 56
Find the output of the following program?
#include<stdio.h>
Void main()
{
char letter=''
printf("\n%c" letter)
}
a) A
b) 65
c) Syntax Error
d) Garbage value
Question 57
Find the output of the following program
#include<stdio.h>
void main()
{
int a; printf("%d",a^a);
}
a) 0
b) 1
c) infinite
d) Error
Question 58
Find the output of the following program?
#include<stdio.h>
void main()
{
int x=0,y=0;
x=(y=75)+9;
printf("\n%d %d", x, y);
}
a) 75,9
b) 75, 84
c) 84, 75
d) None of above
Question 59
Find the output the following C program? #include<stdio.h>
int main()
{
char x=65;
x=x+10;
printf("%d",x) return 0;
}
a) 21
b) 18
c) 15
d) None of above
Question 60
Find the output of the following c program? #include<stdio.h>
{
int i=4,ans;
ans +++ ++ +++i;
printf("%d", ans)
return 0;
}
a) 21
b) 18
c) 15
d) None of above
Question 61
Find the output of the following c program? #include<stdio.h>
{
int x=10;
printf("%d%d%d", x, x++, ++x);
return 0;
}
a) 11 11 11
b) 12 10 10
c) 12 11 10
d) 12 11 11
Question 62
Find the output of the following C program?
#include<stdio.h>
int main()
{
Printf("%d" sizeof(3 3))
Return 0;
}
a) 2
b) 4
c) 8
d) Compiler Error
Question 63
What are the different type of real data type in C?
a) float,doble,char
b) short int,double,long int
c) float,double, long double
d) double,long int, float
Question 64
Which of the following is not logical operator in C?
a) &
b) &&
c) ||
d) !
Question 65
What is the output following C program?
#include<stdio.h>
int main()
{
int k,num=30;
k=(num < 10) ? 100:200;
printf("%d %d", num, k);
return 0;
}
a) 200 30
b) 30 200
c) 100 200
d) 500 500
Question 66
Find the output of the following C program?
#include<stdio.h>
int void()
{
int x,y,z; x=y=z=1;
|Z=++X||++y &&++Z;
printf("x=%d\t y=%d\t z=%d\n", x, y, z);
return 0;
}
a) x=2,y=1,z=1
b) x=2,y=2,z=1
c) x=2,y=2,z=2
d) x=1,y=2,z=1
Question 67
C programming language is
a) object oriented programming language
b) Procedure oriented programming language
c) function oriented programming language
d) None of above
Question 68
Which of the following special symbol allowed in a variable name?
a) _
b) *
c) -
d) !
Question 69
Which of the following is not a keyword
a) void
b) int
c) main
d) for
Question 70
Which of the following is a keyword
a) main()
b) signed
c) integer
d) floating
Which of the following identifier is incorrect
Which of the following identifier is incorrect
Which of the following identifier is correct
Which of identifier is incorrect
Which of the following identifier is incorrect
Which of the following identifier is correct
The memory space taken for a char type data is
The memory space taken for a int type data is
What will be the maximum size of a double variable?
A declaration float a,b; occupies ___of memory
The size of a String variable is
Which of the following is an example of compounded assignment statement?
The operator && is an example for _____ operator.
The memory space taken for a float type data is
The memory space taken for a long double type data is
The memory space taken for a long int type data is
The memory space taken for a signed char type data is
Which of the following is not an escape sequence
Which of the following is an escape sequence
Which of the is not an escape sequence
Which of the following is an escape sequence
The space taken for a unsigned char type data is
The space taken for a unsigned int type data is
Suppose the following statements are written :
Find the values of the following expression (3*i-2*j)%(2*a-b)
Suppose the following statements are written :
Find the values of the following expression (x>y) && (i>0) && (j>5)
Suppose the following statements are written: Int i=9,j=6;
Find the values of the following expression
Suppose the following statements are written:
Find the values of the following expression ++i
Find the output of the following program
int z; z=(x++)+(--y)+y; printf("Value=%d\n" z)
Find the output of the following program
printf("value=%d\n", (a+b*-c));
printf("value=%d\n", (-c/b*c-a)); printf("value=%d\n", (-a+ ++b %a));
Find the output of the following program
Find the output of the following program
printf("a=%d\nb=%d\nc=%d\n", a, b, c);
Find the output of the following program
Find the output of the following program
printf("%d %d%d %d %d", a, b, c, d, x);
Find the output of the following program?
Find the output of the following program?
Find the output of the following program
if(i=5&& z>50) printf("\n Let us C");
Find the output of the following program?
Find the output of the following program?
k=!5 &&j; printf("\n k= %d",k);
Find the output of the following program?
Find the output of the following program?
printf("%d\t%d\t%d\t",i,i-,--i);
Find the output of the following program?
Find the output of the following program?
printf("%d\t%d\t%d\t",i,i++,++i);
Find the output of the following program?
Question 115
Find the output of the following program?
#include<stdio.h>
#include<conio.h>
void main()
{
int i=5;
if(i==0)
{
printf("I am Zero");
}
else
{
printf(" I am Hero");
}
getch();
}
a) I am in Hero
b) I am in Zero
c) Error
d) None of above
Question 116
Why this program runs infinite times
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
for(i=32200;i<=32768;i++)
{
printf("The Value I %d",i);
}
}
a) The range of Integer
b) It will not infinite
c) Error
d) None of the above
Question 117
What is the error in following code?
if(z=100)
printf("z is 100");
a) 100 should be written in double quotations in the first line
b) variable z should be inside double quotations in the first line
c) Mistakes in the equals to operator
d) There is no semicolon (;) at the end of first line
Question 118
Which of the following is a decision statement in C?
a) if-else
b) switch-case
c) both a & b
d) do-while
Question 119
The continue statement is used to:
a) resume the program when it is hanged
b) resume the program if a break statement is given
c) skips the rest of the loop in current iteration
d) none of the above
Question 120
Observe the following block of code and determine what happens when x=2? switch(x)
{
case 1: printf("x is 1");
break;
case 2:
case 3: printf("x is 3");
break;
}
default:
printf("X is not within the range");
a) Program jumps to the end of switch statement since there is nothing to do for
x=2
b) The code inside default will run since there is no task for x=2,so
c) Will display x is 3,and then come outside the switch statement
d) None of above
Question 121
Which of the following is false for a "switch" statement in C?
a) break statement is false is compulsory after each case
b) default statement is compulsory
c) There is a limit on the maximum number of cases
d) None of above
Question 122
Find the output of following code
#include<stdio.h>
void main()
{
int s=0;
while(s++<10)
{
if(s>3&& s<10)
continue;
printf("\n%d\t", s);
}
}
a) 1 2 3 4 5 6 7 8 9
b) 1 2 3 10
c) 4 5 6 7 8 9 10
d) 4 5 6 7 8 9
Question 123
Find the output of the following c code
#include<stdio.h>
#include<string.h>
void main()
{
int i=0;
for(;i<=2;)
printf("%d", ++i);
}
a) 0 1 2
b) 1 2 3
c)01 2 3
d) Infinite Loop
Question 124
How many times "C" is get printed?
#include<stdio.h>
void main()
{
int x;
for(x=0;x<=10; x++)
{
if(x<5)
continue;
else
break;
printf("C");
}
}
a)5 Times
b)11 Times
c) 0 Times
d) 10 Times
Question 125
Find the output of the following program
#include<stdio.h>
void main()
{
int x=500,y=100,z;
if(!x>=400)
y=300;
z=200;
printf("y=%d z=%d\n", y, z);
}
a) y=100
z=200
b) y=300
z=garbage
c) y=100
z=garbage
d) y=300
Z=200
Question 126
find the output of the following program
#include<stdio.h>
void main()
{
C
int i=1;
switch(i)
{ printf("Hello\t");
case 1:
printf("Hi\t");
case 2:
printf("\nBye\n");
break
}
}
a) Hi
b) Bye
c) Bye Hi
d) Hello Bye
Question 127
To repeat a set of the statements for 25 times, which kind of statement will be required?
a) Iterative
b) Selective
c) Either a or b can be used
d) None of the above
Question 128
To perform one of the many operations selected based on a condition, which kind of statement will be required?
a) Iterative
b) Selective
c) Either a or b can be used
d) None of the above
Question 129
"break" statement is compulsory after every case in the "switch-case" statement
a) True
b) False
c) Depends on the condition
d) None of the above
Question 130
"continue" statement when executed the control is transferred
a) Outside the loop,to the next statement after the loop
b) beginning of the loop i.e. to the first statement in the loop
c) outside the function, to the next function in the program
d) beginning of the function i.e. to the first statement in the function
Question 131
Find the output of the following program
#include<stdio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("1");
}
printf("\n");
}
}
a) 1
11
111
1111
111111
b) 1 1 1 1 1
c) 1
1
1
1
1
d)1 1 1 1 1
1 1 1 1
1 1 1
1 1
1
Question 132
The break statement is used to exit from a
a) DO loop
b) FOR loop
c) SWITCH statement
d) All of the above
Question 133
A leading "0" indicates that the number following is an octal (base 8) number. For example the compiler will interpret "011" as the octal number 011 and use as decimal value.
Find the following program
#include<stdio.h>
void main()
{
int x=011,i;
for(i=0;i<x;i+=3)
{ printf("Error")
continue;
printf("Exit")
}
}
a) EnterExitEnterExitEnterExit
b) EnterEnterEnter
c) EnterEnterEnterExit
d) None of the above
Question 134
Which is the correct way to declare a pointer?
a) int_ptr;
b) int *ptr;
c) *int ptr;
d) None of these.
Question 135
The return type of a function that does not have any return type is declared
a) long
b) double
c) void
d) int
Question 136
Parameters passed to a function are separated with
a) comma
b) semi-colon(;)
c) colon(:)
d) None of the above
Question 137
Variables declared inside the parenthesis of a function have__________________ visibility.
a) Local
b) Global
c) Module
d) Universal
Question 138
String is an array of character arrays terminated with__________
a) \n
b) it
c) 10
d) \1
Question 139
According to the following code, select the best suitable
int x=5,y=3,z;
a=add(&x,&y);
a) The function add is called by passing the values
b) The function add is called by passing reference
c) Both (a and b) of above
d) None of above
Question 140
If the type specifier of parameters of a function call is followed by an ampersand (&) and then the variable names, that function call is
a) pass by value
b) pass by reference
c) pass by variables
d) none of above
Question 141
When an array is passed to a function, it can said that________________________________ is passed
a) Address of the array
b) Value of the first element of the array
c) Address of the first element of the array
d) Number if elements in the array
Question 142
Find the output of the following program?
#include<stdio.h>
void main()
{
char *str="Hello world";
printf("%s", str);
}
a) Hello world
b) Error
c) Garbage value
d) None of the above
Question 143
Find the output of the following program?
#include<stdio.h>
int main()
{
char str[]="C-program";
int a = 5;
printf(a >10?"Ps\n":"%s\n", str);
return 0;
}
a) C-program
b) Ps
c) Error
d) None of the above
Question 144
Every program must have atleast ____________function(s)
a) 1
b) 2
c) 3
d) None of the above
Question 145
A void return type for a function indicates that a) The function cannot return any data
b) The function can return any type of data
c) The function can return any type of data except for "int"
d) None of the above
Question 146
The value returned by a function is returned to the
a) main function
b) Operating System
c) caller function
d) called function
Question 147
The parameters passed by the caller function are called as the_________parameters
a) actual
b) formal
c) informal
d) reference
Question 148
The prototype of a function can be written
a) only outside a function
b) only inside a function
c) both inside and outside a function
d) only with prefix'#'
Question 149
A recursive function may or may not have a condition such that there is an exit from the function calling itself again
a) True
b) False
c) ?
d) ?
The actual and formal parameters are
a) same variables with different names
b) different variable name with same memory location
c) different memory location with different variable names
d) different memory location with same or different names
The starting index of an array is always_______________
The index of the last element of an array of "n? elements will be_____
The memory space allocated to the array declared as:
The 10th element of an array "a" can be accessed as
An array of characters terminated with a null character is called as________
The ASCII value of the null character stored at the end of the string is_________
To accept a string from user, which of the following is used
The header file that has various string functions like strcpy(),strcat(),ect is
The initial of an automatic storage class variable is ______________
What is the output of the above program code?
printf("%d %d %d", *p, **p1, *(*p1));
An entire structure or union variable can be assigned to another structure or union variable if
a) The two variables have same composition
b) the two variable have same type
c) Assignment of one structure or union variable to another is not possible
Find the output of the following program
Find the output of the following program
printf("%d", sizeof(p)+sizeof(q));
Which of the following is not user defined data type?
Find the output of the following program
printf("%d %f", e.age, e.sal);
What is the similarity between a structure,union and enumeration?
a) All of them let you define new values
b) All of them let you define new datatype values
c) All of them let you define new pointers
d) All of them let you define new structures
With reference to the pointers the "*" operator returns the ______________________
Find output of the following program
Read the statements given bellow and select the correct statement
a) p1 is a pointer to pointer p
The total memory space allocated for a variable of a structure is equal to___________
a) Memory space required by the largest member variable of the structure
b) sum of memory space required by the all member variable of the structure
Which of the following operator is used to select a member of a structure variable
what is the value of expression *P++?
Which of the following statement cause program control to end up almost anywhere
Which of the following statement allows us to make a decision from the number of
Which of the following keyword is followed by an integer or character constant?
Which of the following enhances the versatility of the computer to perform a set of
Which of the following contains parenthesis after the "while" loop?
The three things inside the for loop are separated by
Which of the following statement associated with an "if" ?
"do while" loop is useful when we want that statement within the loop must be executed
Which of the following statement allows the programmer to make the control to
the beginning of the loop, without executing the statement inside the loop?
Which of the following can be replaced by if
Which of the following statement is useful while writing menu driven programs
The function gets called when the function name is followed by
The mechanism used to convey information to the function is the
Find the output of the following program?
A structure is a collection of
a) Address of another variable
b) Address of another variable of same type
Default return type of a function is
b) Array of character terminated by '\0'
How many keywords are available in c language
Which of the followings is not a keyword of c language
The C source file is processed by the_______
d) Both interpreter and compiler
What is the extension of c programming
For which type, the format specifier "%" is used?
Which is the correct format specifier for double type value in C?




Comments
Post a Comment