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

C MCQ 1

Uploaded by

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

C MCQ 1

Uploaded by

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

c question

sl no question option1
1 Which of the following is not a valid C variable name? a) int number;
2 Which is valid C expression? a) int my_num =
a) volatile
3 Which of the following cannot be a variable name in C?
4 Which of following is not accepted in C? a) static a = 10;
5 What is #include <stdio.h>? a) Preprocessor

6 C preprocessors can have compiler specific features. a) True

a) #

7 The C-preprocessors are specified with _________ symbol.

#include <stdio.h>
int main()
{
int y = 10000; a) Compile
int y = 34; time error
printf("Hello World! %d\n", y);
return 0;
8 }

#include <stdio.h>
int main()
{ a) It will cause
int main = 3; a compile-time
printf("%d", main); error
return 0;
}
9

#include <stdio.h>
int main()
{
signed char chr;
chr = 128; a) 128
printf("%d\n", chr);
return 0;
10 }
#include <stdio.h>
void main()
{
float x;
int y;
printf("enter two numbers \n", x); a) 7.000000, 7
scanf("%f %f", &x, &y);
printf("%f, %d", x, y);
11 }

#include <stdio.h>
void main()
{ a) returns 1
1 < 2 ? return 1: return 2;
12 }

#include <stdio.h>
int main() {
int a = 3, b = 5;
int t = a;
a = b;
b = t;
printf("%d %d", a, b);
return 0;
13 } 35

What is the size of the int data type (in bytes) in C?

14 4

15 Which of the following are not standard header files in C? stdio.h

In which of the following languages is function


16 overloading not possible? c

Which of the following are correct file opening modes in


17 C? r
#include<stdio.h>
main()
{
/* Multi Line Comment
This line is ignored by compiler A) #include is a
*/ Preprocessor
printf("Hello C.."); Directive
18 }

A)
/*printf("Hello
C..");
printf("How
are you.");

19 Correct way of commenting a single line is.?

A) C++ Style
Comment

20 Single Line Comment // is also called.?

A) int myage =
10;
int my_age =
21 Choose a right statement. 10;

int main()
{
int a=0;
a =20;
printf("%d",intmain());

return 0;
22 } a)20

#include<stdio.h> int main()


{
int a=0;
a = printf("4");
printf("%d",a);

return 0;
23 } a. 4 0
a) 0 to 256

24 What is the valid range of numbers for int type of data?

Which escape character can be used to beep from


speaker in C?

25 a) \a

Character constants should be enclosed between ___

a) Single
26 quotes

Which of the following is invalid?

27 a) ‘’

The maximum length of a variable in C is ___

28 a) 8

What will be the maximum size of a float variable?

29 a) 1 byte
The size of a String variable is

30 a) 1 byte
c question
option2 option3 option4 ans focus
b) float rate; c) int variable_count; d) int $main; d basic
b) int my_num = 100000; c) int my num = 1000; d) int $my_num = 10000; b basic

b) true c) friend d) export a basic


b) static int func (int); //parameter asc) static static int a; d) all of the mentioned c basic
b) Inclusion directive c) File inclusion directived) None of the mentioned a basic
b) False

c) Depends on the standd) Depends on the platforma basic

b) $ c) ” ” d) & a basic

b) Hello World! 34 c) Hello World! 1000 d) Hello World! followed bya basic

c) It will run without


b) It will cause a run-time error any error and prints 3 d) It will experience infinit c basic

c) Depends on the
b) -128 compiler d) None of the mentioned b basic
b) Run time error c) 7.000000, junk d) Varies c basic

b) returns 2 c) Varies d) Compile time error b basic

33 55 53 53 basic

8 2 1 4 basic

stdlib.h conio.h non of them conio.h basic

c++ java phython c basic

rb w non of them w basic


C)
#include
main()
{

}
is a mandatory
function to be included
B) <stdio.h> is a header file with predin every C Program. D) All the above D basic

C) /*printf("Hello C..");
printf("How are D) /printf("Hello C..");/
B) //printf("Hello C..");printf("How aryou.");*/ printf("How are you."); b basic

B) Java Style Comment C) PHP Style Comment D) All the above D basic

B) int myage = 10;


int my,age = 10;
C) int myage = 10;
D) All are right int my age = 10; D) All are right A basic

b)infinity lool c)error d)non of them b basic

b.4 c.compile error d.4 1 d basic


b) -32768 to +32767 c) -65536 to +65536 d) No specific range b basic

b) \b c) \m d) \n a basic

b) Double quotes c) Both a and d) None of these a basic

b) ““ c) ‘a’ d) ‘abc’ d basic

b) 16 c) 32 d) 64 a basic

b) 2 bytes c) 4 bytes d) 8 bytes c basic


b) 8 bytes

c) 16 bytes d) None of these d basic

You might also like