C Programming Objective Questions and Answers for Gate Exam - Practice SET2

c programming important questions and answer pdf,c interview questions


C Programming Based Practice Questions for GATE Computer Science

Hello friends welcome to Computer Science Junction portal . Today we will practice some c programming mcq.



1. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
(a) rem = 3.14 % 2.1;
(b) rem = modf(3.14, 2.1);
(c) rem = fmod(3.14, 2.1);
(d) Remainder cannot be obtained in floating point division.

It's Solution Explanation

2. What are the types of linkages?

(a) Internal and External (b) External, Internal and None
(c) External and None (d) Internal

It's Solution Explanation

3. Which of the following special symbol allowed in a variable name?

(a) * (asterisk) (b) | (pipeline)
(c) - (hyphen) (d) _ (underscore)


It's Solution Explanation

4. Is there any difference between following declarations?

1: extern int fun();
2: int fun();

(a) Both are identical
(b) No difference, except extern int fun(); is probably in another file
(c) int fun(); is overrided with extern int fun();
(d) None of these

It's Solution Explanation

5. How would you round off a value from 1.66 to 2.0?

(a) ceil(1.66) (b) floor(1.66)
(c) roundup(1.66) (d) roundto(1.66)

It's Solution

6. By default a real number is treated as a:

(a) float (b) double
(c) long double (d) far double

It's Solution

7. Which of the following is not user defined data type?

1: struct book
{
char name[10];
float price;
int pages;
};
2: long int l = 2.35;
3: enum day {Sun, Mon, Tue, Wed};
(a) 1 (b) 2
(c) 3 (d) Both 1 and 2

It,s Solution

8. Is the following statement a declaration or definition?
extern int i;

(a) Declaration (b) Definition
(c) Function (d) Error

It's Solution




C Programming for gate cse


9. Identify which of the following are declarations:

1: extern int x;
2: float square ( float x ) { ... }
3: double pow(double, double);
(a) 1 (b) 2
(c) 1 and 3 (d) 3


It's Solution

10. 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;

(a) extern int a is declaration, int a = 20 is the definition
(b) int a = 20 is declaration, extern int a is the definition
(c) int a = 20 is definition, a is not defined
(d) a is declared, a is not defined

It's Solution

11. When we mention the prototype of a function?

(a) Defining (b) Declaring
(c) Prototyping (d) Calling

It's Solution


12. What is (void*)0?
(a) Representation of NULL pointer (b) Representation of void pointer
(c) Error (d) None of above

Answer (a)

13. Can you combine the following two statements into one?
char *p;
p = (char*) malloc(100);
(a) char p = *malloc(100); (b) char *p = (char) malloc(100);
(c) char *p = (char*)malloc(100); (d) char *p = (char *)(malloc*)(100);

Solution: Option (c)

14. In which header file is the NULL macro defined?
(a) stdio.h (b) stddef.h
(c) stdio.h and stddef.h (d) math.h

Solution: Option (c)

15. How many bytes are occupied by near, far and huge pointers (DOS)?
(a) near=2 far=4 huge=4 (b) near=4 far=8 huge=8
(c) near=2 far=4 huge=8 (d) near=4 far=4 huge=8

It's Solution

16. If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
(a) . (b) &
(c) * (d) ?


Solution: Option (d)

17. What would be the equivalent pointer expression for referring the array element a[i][j][k][l]?
(a) ((((a+i)+j)+k)+l) (b) *(*(*(*(a+i)+j)+k)+l)
(c) (((a+i)+j)+k+l) (d) ((a+i)+j+k+l)

Solution: Option (b)


18. A pointer is:
(a) A keyword used to create variables
(b) A variable that stores address of an instruction
(c) A variable that stores address of other variable
(d) All of the above

Solution: Option (c)

19. The operator used to get value at address stored in a pointer variable is:
(a) * (b) &
(c) && (d) ||

Solution: Option (a)

20. What is the output of the program given below?
#include
int main()
{
enum status { pass, fail, atkt};
enum status stud1, stud2, stud3;

stud1 = pass;
stud2 = atkt;
stud3 = fail;
printf("%d, %d, %d\n", stud1, stud2, stud3);
return 0;
}
(a) 0, 1, 2 (b) 1, 2, 3
(c) 0, 2, 1 (d) 1, 3, 2

It's Solution

Keywords:  C Programming Multiple Choice Questions and Answers, C Multiple Choice Questions and Answer,C Programming Online Quiz,C Multiple Choice Questions, c aptitude questions and answer with explanation,c language tutorial,c programming tutorial, c programming tutorial pdf, c cat exam, c and c++ questions and answers for freshers,






COMMENTS

Name

addressing modes types,1,advance-java,2,advancejava,1,aktu entrance exam,1,aktu exam schedule,1,ASP,1,bare machine,1,base register and limit register,1,Basic Computer network questions,1,C Programming,15,C Plus Plus,1,C Programming,2,C Programming MCQ,2,C Programming Questions,2,C programming study material for gate exam,13,Cache Memory,1,CBNST Program,1,Childcare,1,CJ,2,Cloud Computing,1,COA GATE Questions,1,components of use case diagram,1,Computer Architecture,2,Computer architecture based questions for gate exam,11,Computer Network,3,Computer Network Study Material,4,Computer network study material for gate,2,Computer Networks,7,Computer networks GATE Questions,1,Computer Science Study Material for Gate,20,computer science study material for gate exam,36,content based image retrieval content based image retrieval system,1,contiguous memory allocation,2,Core Java,8,COre Java Interview Questions,1,core java interviews questions,1,cyber crime report,1,Cyber crime status,1,cybercrime and security,1,cybercrime examples,1,Data link Layer Questions,1,Data Mining,1,Data Structure Questions,1,Data Transmission Architecture,1,Data Transmission in wsn,1,DBMS,4,dbms question paper,1,DE,1,Digital Electronics,1,DS,1,dynamic linking,1,dynamic linking in memory management,1,Electroencephalogram,1,File Handling,1,file management in operating system notes,1,FOC,1,Fundamenatl of Computer,1,Gate 2017,5,Gate 2017 Admit card,1,Gate 2017 Exam Schedule,1,Gate 2017 Syllabus,1,gate 2018,1,gate cse study material,1,gate practice set,10,gate study material for computer science,18,Gate study material for computer science 2017,1,GatePreviousYear,1,General,3,HCL Aptitude Test,1,HR Interview Questions,1,HTML,1,Image Processing,1,Important Date of Gate 2017 Exam,1,Information Security Policy,1,internal and external fragmentation,1,JS,1,lagrange's interpolation formula,1,lagrange's interpolation formula examples,1,Looping in C,1,MComputing,1,memory fragmentation,1,memory management,1,memory management questions and answer in os,1,Motivational,4,NCER,2,Numerical Techniques Lab,1,OOT,1,Operating System,12,Operating System Gate Questions,1,Operating System Objective Questions,4,Operating System Questions Bank,1,Operating system questions for gate,1,Operating System Study material,2,operating system study material for gate exam,16,Operating system tutorial,2,page swapping,1,paged memory allocation,1,paged memory allocation in operating system,1,paging technique of memory management .paging technique,1,paging technique of memory management program in c,1,Pointer in C,5,Process based question for gate,1,Quiz on non conventional energy resources,1,Regression testing,1,relocation in memory management,1,relocation registe,1,relocation register,1,resident monitor,1,resident monitor in operating system,1,routing table,1,segmentation in memory management,1,segmentation in memory management in operating system,1,Servlet,1,session tracking,1,session tracking in java,1,session tracking in servlet,1,Software Engineering,10,Software Engineering baes study material for gate,1,software engineering interview questions,1,Software Quality Assurance,3,software verification methods,1,SPM,1,Structure in C,1,Study Material for gate Computer Science,11,swapping in memory management,1,swapping in operating system,1,TCS Code Vita,1,TCS Interview Questions,1,Technical Interview,1,Technical Questions from DBMS,1,Thrashing in Operating System,1,Threads concept in operating system,1,Tips to Learn Coding,1,Top 30 Core Java Interview Questions with Answer,2,top down approach,1,top down approach in programming,1,Types of operating system,1,UML,1,use case diagram explanation,1,website uses cookies,1,what is cookies website,1,What is process control block ?,1,what is software testing?,1,Wireless Sensor Network,3,worst fit algorithm for memory allocation,1,XML,1,
ltr
item
Computer Science Junction: C Programming Objective Questions and Answers for Gate Exam - Practice SET2
C Programming Objective Questions and Answers for Gate Exam - Practice SET2
c programming important questions and answer pdf,c interview questions
https://4.bp.blogspot.com/-48ptvkRctMs/WklBWEDGNyI/AAAAAAAAAkY/6To7ROL2TmEGAwJ1JgPT_t8FYQLUCmmJQCLcBGAs/s400/cprogammingforgate.png
https://4.bp.blogspot.com/-48ptvkRctMs/WklBWEDGNyI/AAAAAAAAAkY/6To7ROL2TmEGAwJ1JgPT_t8FYQLUCmmJQCLcBGAs/s72-c/cprogammingforgate.png
Computer Science Junction
https://www.computersciencejunction.in/2018/03/c-programming-mcq-questions.html
https://www.computersciencejunction.in/
https://www.computersciencejunction.in/
https://www.computersciencejunction.in/2018/03/c-programming-mcq-questions.html
true
425357657003182083
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy