C Only Question
C Only Question
Overview Of C
Basic Structure of C Programming
Keywords in C
Identifiers in C
Format Specifiers
Format Specifiers Examples etc
Data Types in C Language
Introduction to Data Types in C
int Data Type in C
float Data Type in C
double Data Type in C
char Data Type in C etc
Variable in C Language
Variable Introduction in C
Variable Declaration and Initialization
Variable types and Scope in C
Local Variable in C
Static Variable in C
Global variables in C
Storage Class in C etc
Constant in C Language
Constants in C ,etc
Operators and Enums in C Language
Introduction to Operator
Arithmetic Operators in C
Relational Operators in C
Bit-wise Operators in C
Logical Operators in C
Assignment Operators in C
Conditional Operator in C
sizeof() Operator in C
Operator Precedence. etc
Decision Making of C Language
Decision Making in C Introduction
if Statement
if-else Statement
Nested if Statement
if else if Ladder
switch case. etc
Loop control in C Language
Loop Introduction in C
while loop in C
do while Loop In C
for Loop in C ,etc
Control Flow in C Programming
break Statement in C
continue Statement in C
go to Statement in C .etc
Array in C Language
Single Dimensional Array
Multi-Dimensional Array in C .etc
String & String functions in C
All String Functions
strcat() function
strncat() function
strcpy() function
strncpy() function
strlen() function
strcmp() function.etc
Function in C Language
Function in C
Function Calling in C
return type in Function
Call by Value in C
User Define Function
Predefined Functions. etc
Recursion in c
Introduction to Recursion
Direct and Indirect Recursion, etc
Pointer in C Language
Pointer in C
types of pointer
NULL pointer
Pointer and Array
Strings as pointers
Pointer to Function.etc
Structure in C Language
Structure in C
Nested Structure in C
Array of Structures in C
Pointer to Structure
Structure to Function in C
typedef in C, etc
Union in C Language Dynamic Memory Allocation
Union in C
CPrecedenceTable
*= /= %= Right to Left
= \= Right to Left
int main()
{
char A = 10;
int *b;
int a[][3]={0,1,2};
char B='11';
b=a;
for (int i=0;i<=2;i++)
{
printf("%d\t",b[i]);
}
return 0;
}
(a) Compilation Error (b) 0 1 2
(c) 0 11 2 (d) 0 1 2 11
Q11. What will be the output of following program?
#include <stdio.h>
int main()
{
char A = ‘70’;
int *b;
char B='11';
int C = "A";
printf("%d %c ",C,B);
C Programming GATE-2020 Page 4
return 0;
}
(a) Compilation Error (b) 65 1
(c) A 11 (d)None Of above
return 0;
}
(a) 4 8 (b) 8 8 (c)8 4 (d)4 4
Q16. What will be the output of following program?
#include <stdio.h>
#define SIZE(arr) sizeof(arr) / sizeof(*arr);
void fun(int* arr, int n)
{
int i;
*arr += *(arr + n - 1) += 15;
}
void printArr(int* arr, int n)
{
int main(void)
{
int x[2 ][3]={1,2,3,4,5,6,7};
printf("%d",*(*(1+x)+1));
return 0;
}
(a)5 (b)6 (c)7 (d)8
Q20. For the following questions, use the declaration of variables shown below. You can
try building a simple program using the given specification in order to answer the
questions.
int i, j[5] = {4, 5, 6, 7, 8}, *ptr1 = &j[0], *ptr3;
float x[5] = {4.0, 5.0, 6.0, 7.0, 8.0}, *ptr2;
1. For each statement below, specify which are valid and which aren’t.
a. ptr1 = ptr1 + 3; _________
b. j = j + 1; _________
c. ptr1 = j + 1; _________
d. ptr2 = ptr1; _________
e. ptr1 = j[1]; _________
f. ptr1 = 2; _________
g. i = ptr1; _________
h. ptr3 = ptr1; _________
i. i = j[2]; _________
j. ptr2 = x; _________
k. ptr1 = ptr1[2]; _________
l. x = &ptr2[2]; _________
m. j = ptr1 + 3; _________
n. ptr1 = &j[1]; _________
while(i<3)
{
sum += *(*(arr+i)+(i++));
}
printf("sum:%d", sum);
}
(a) sum:15 (b)sum:11 (c)sum:16 (d)sum:18
return 0;
}
(A) 4 Sachin Sachin (B) 4 dhoni dhoni
(C) 5 dhoni Sachin (D) Compilation Error
Q50. What will be the output of following C program?
#include<stdio.h>
int main()
{
short int si = 2;
switch(si+++si - ++si)
{
case 1:
printf("IIT");
break;
case 2:
printf("NIT");
break;
default:
printf("IIIT");
break;
}
return 0;
}
/* Function declarations */
int add(int, int);
int sub(int, int);
int main()
{
int sum, diff;
int (* arith)(int, int); // Function pointer declaration
printf("%d\t", sum);
printf("%d", diff);
return 0;
}
/* Function definition */
int add(int num1, int num2)
{
return (num1 + num2);
}
int main ()
{
int array[] = { 45, 67, 89 };
int *array_ptr = & array[1];
printf("%i\n", array_ptr[1]);
return 0;
}
(A)67 (B) 45 (C)89 (D) Compilation Error