Sunteți pe pagina 1din 5

1) C99 standard guarantees uniqueness of ____ characters for internal names

63

2) The format identifier '%i' is also used for _____ data type?
Int

3) Array passed as an argument to a function is interpreted as


Adresses of the first elements of the array

4) Which of the following is the feature of stack?


All operations are at one end

5) What will be the output of the following statements ?


int i = 1,j; j=i--- -2; printf("%d",j);
3

6) Recursion always requires ?


a)Termination of the algorithm
b)key variable
c)base value

7) Storage class of a variable determines ?


Scope

9) scanf( ) function can be used for reading ?


Multiple character

10) A C variable start with ?


Underscore

11) Can the above code be compiled successfully?


#include
struct p
{
int k;
char c;
float f;
};
int main()
{
struct p x = {.c = 97, .f = 3, .k = 1};

printf("%f\n, x.f);
}
Depends on the standard value

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


Float

13) In the following program where is the variable a getting defined and where it is
getting declared?
#include
int main()
{
extern int a;
printf(\"%d\\n\", a);
return 0;
}
int a=20;
Extern int a is declaration, int a=20 is the definition

14) What is the output of this C code?


#include
int main()
{
int i = 10, j = 3;
printf("%d %d %d", i, j);
}
10 3 some garbage value

15) What is the output of this C code?


#include
void main()
{
char *p = calloc(100, 1);
p = "welcome";
printf("%s\n", p);
}
Error

2) C99 standard guarantess uniqueness of _____ characters for external names.


31

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

Int 3_a
5) Why can't variable names begin with underscore?
To avoid conflicts since library routines use such names
6) All keywords in C are in
Lowercase
7) Resolving of Variable names(number of significant characters for uniqueness of
variable) depends on
Compiler and linker implementations
8) Which of the following is not a valid C variable name?
Int $main

9) Which of the following is true for variable names in C?


Variable names cannot start with digit

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

13) What is the size of an int data type?


Depends on the system/compiler

15) Which of the following is a User-defined data type?


Typedef int Boolean, typedef enum {} workdays, struct {char name[10], int
age}

1) void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf("EXAM");
}
}
What will be the output of the above program?
Nothing is printed

3) What is the output of the following code?


#include
void main()
{
int s=0;

while(s++<10)
{
if(s<4 && s<9)
continue;
printf("\n%d\t",s);
}

4 5 6 7 8 9 10

4) What is the output of the following code?


# include
# define a 10
main()
{
printf("%d..",a);
foo();
printf("%d",a);
}
void foo()
{
#undef a
#define a 50
}
10..10

6) Which of the following is the correct way of declaring a float pointer:


Float*ptr

7) realloc(ptr, size), where size is zero means


Free the memory pointer to by ptr

10) "C" was primarily developed as a


system programming language

11) What is the output of this C code?


#include
struct student
{
int no;
char name[20];
}
void main()
{

struct student s;
s.no = 8;
printf("hello");
}
Error

12) What is the output of this C code?


#include
int main()
{
int i = 10, j = 3, k = 3;
printf("%d %d ", i, j, k);
}
10 3

13) What does the following command line signify?


prog1|prog2
Its runs both the programs, pipes output of programs1 to input of programs2

14) The directives for the preprocessors begin with


Two slashes(//)

S-ar putea să vă placă și