SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
For more MCQ Question visit www.csemcq.com
Q1. If an integer need 2 bytes of storage then the maximum value of an signed integer is:
a) 216
-1
b) 215
-1
c) 216
d) 215
Ans b
Explanation: In signed magnitude form one bit is used to store the sign so only 15 bits are
available to store the value.
Q2. If cse is an input then the following program fragment results in
Char x,y,z;
Printf(“%d”,scanf(“%c”, “%c”, “%c”,&x,&y,&z)); results in
a) Syntax error
b) A fatal error
c) Segmentation violation
d) Printing of 3
Ans d
Explanation: Scanf() function returns number of successful matches I.e. 3 in this case
Q3 The statement printf(“%d”,sizeof(“”)); prints
a) An error message b) 0 c) garbage d) 1
Ans d
Q4 The following program fragment:
if (a=5)
printf(“a is five”);
else
printf(“a is not five”);
result in the printing of
a) a is five
b) a is not five
c) nothing
d) garbage
ans a
q5 main()
For more MCQ Question visit www.csemcq.com
{
Int i=5;
i=(++i)/(i++);
printf(“%d”,i);
}
prints:
a) 2 b) 5 c) 1 d) 6
Ans a
Q6 The statement printf(“%d”,10?0?5:11:12);
prints:
a) 10 b) 0 c) 12 d) 11
Ans d
Q7 if you are using “open” function for opening a file the file handle should be of--------type
a)FILE
b) int
c) char
d)none of the above
ans a;
Q8 What will be the output of following program:
#define ISLOWER(a)(a>=97&&a<=127)
#define TOUPPER(a)(a=a-32)
int main()
{
char ch=’c’;
if(ISLOWER(ch))
ch=TOUPPER(ch);
printf(“%c”,ch);
}
Ans a)C b)c c)99 d) None of the above
Q9.
Find the output of program:
int main()
{
int i;
For more MCQ Question visit www.csemcq.com
for(i=-1;i<=10;i++)
{
if(i<5)
continue;
else
break;
printf("gets printed only once");
}
}
Ans a)No output b) Gets Printed only once c)Error d) None
Q10
Find the output of program:
int main()
{
if(printf("C for yourself how it worksn"))
getch();
}
a) Error b) C for yourself how it works c) none
e) C for yourself how it works
C for yourself how it works
C for yourself how it works
C for yourself how it works
----------------------------------
Ans b

Weitere ähnliche Inhalte

Was ist angesagt?

Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit i
sonalisraisoni
 
Program for pyramid
Program for pyramidProgram for pyramid
Program for pyramid
nayakq
 

Was ist angesagt? (20)

Lab loop
Lab loopLab loop
Lab loop
 
comp2
comp2comp2
comp2
 
comp1
comp1comp1
comp1
 
C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit i
 
C++ questions
C++ questionsC++ questions
C++ questions
 
Exam for c
Exam for cExam for c
Exam for c
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Lab. Programs in C
Lab. Programs in CLab. Programs in C
Lab. Programs in C
 
The solution manual of c by robin
The solution manual of c by robinThe solution manual of c by robin
The solution manual of c by robin
 
Progr3
Progr3Progr3
Progr3
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
C Programming
C ProgrammingC Programming
C Programming
 
C++ assignment
C++ assignmentC++ assignment
C++ assignment
 
Program for pyramid
Program for pyramidProgram for pyramid
Program for pyramid
 
C
CC
C
 
some basic C programs with outputs
some basic C programs with outputssome basic C programs with outputs
some basic C programs with outputs
 
Hargun
HargunHargun
Hargun
 
CSC – 184 Programming C
CSC – 184 Programming CCSC – 184 Programming C
CSC – 184 Programming C
 

Andere mochten auch

Multiple choice questions with answers
Multiple choice questions with answersMultiple choice questions with answers
Multiple choice questions with answers
Classic Tech
 
Mgt501 mega solved_file_for_exam_www.vustudents.net
Mgt501 mega solved_file_for_exam_www.vustudents.netMgt501 mega solved_file_for_exam_www.vustudents.net
Mgt501 mega solved_file_for_exam_www.vustudents.net
Inder Samant
 
Notes for mba (strategic management) unit i
Notes for mba (strategic management) unit iNotes for mba (strategic management) unit i
Notes for mba (strategic management) unit i
snselvaraj
 
110 mcqs of HR Management Solved
110 mcqs of HR Management Solved 110 mcqs of HR Management Solved
110 mcqs of HR Management Solved
Aasim Mushtaq
 

Andere mochten auch (15)

Multiple choice questions with answers
Multiple choice questions with answersMultiple choice questions with answers
Multiple choice questions with answers
 
C programming & data structure
C programming & data structureC programming & data structure
C programming & data structure
 
New Syllabus MBA 2yrs MDU DDE, Rohtak
New Syllabus MBA 2yrs MDU DDE, RohtakNew Syllabus MBA 2yrs MDU DDE, Rohtak
New Syllabus MBA 2yrs MDU DDE, Rohtak
 
C programming & data structure [character strings & string functions]
C programming & data structure   [character strings & string functions]C programming & data structure   [character strings & string functions]
C programming & data structure [character strings & string functions]
 
Davidson mc qs
Davidson mc qsDavidson mc qs
Davidson mc qs
 
Hrm for competetive exams
Hrm for competetive examsHrm for competetive exams
Hrm for competetive exams
 
Quiz HR
Quiz  HRQuiz  HR
Quiz HR
 
Nailing an MCQ Question
Nailing an MCQ QuestionNailing an MCQ Question
Nailing an MCQ Question
 
Mgt501 mega solved_file_for_exam_www.vustudents.net
Mgt501 mega solved_file_for_exam_www.vustudents.netMgt501 mega solved_file_for_exam_www.vustudents.net
Mgt501 mega solved_file_for_exam_www.vustudents.net
 
HR Quiz
HR QuizHR Quiz
HR Quiz
 
Human Resource Management Quiz
Human Resource Management QuizHuman Resource Management Quiz
Human Resource Management Quiz
 
Notes for mba (strategic management) unit i
Notes for mba (strategic management) unit iNotes for mba (strategic management) unit i
Notes for mba (strategic management) unit i
 
Steve Jobs Inspirational Quotes
Steve Jobs Inspirational QuotesSteve Jobs Inspirational Quotes
Steve Jobs Inspirational Quotes
 
110 mcqs of HR Management Solved
110 mcqs of HR Management Solved 110 mcqs of HR Management Solved
110 mcqs of HR Management Solved
 
Deep C
Deep CDeep C
Deep C
 

Ähnlich wie C mcq practice test 1

1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf
ezzi97
 
C language questions_answers_explanation
C language questions_answers_explanationC language questions_answers_explanation
C language questions_answers_explanation
srinath v
 
(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
Pamidimukkala Sivani
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
gitagrimston
 
famous placement papers
famous placement papersfamous placement papers
famous placement papers
Ramanujam Ramu
 
New microsoft office word document (3)
New microsoft office word document (3)New microsoft office word document (3)
New microsoft office word document (3)
Sagar Kuchekar
 

Ähnlich wie C mcq practice test 1 (20)

important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
LET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERSLET US C (5th EDITION) CHAPTER 2 ANSWERS
LET US C (5th EDITION) CHAPTER 2 ANSWERS
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
 
UNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptxUNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptx
 
1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf1. Which of the following statements would correctly print out t.pdf
1. Which of the following statements would correctly print out t.pdf
 
C MCQ
C MCQC MCQ
C MCQ
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
C-programs
C-programsC-programs
C-programs
 
C language questions_answers_explanation
C language questions_answers_explanationC language questions_answers_explanation
C language questions_answers_explanation
 
Technical questions for interview c programming
Technical questions for interview  c programmingTechnical questions for interview  c programming
Technical questions for interview c programming
 
(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
Revision1schema C programming
Revision1schema C programmingRevision1schema C programming
Revision1schema C programming
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
Deep C Programming
Deep C ProgrammingDeep C Programming
Deep C Programming
 
C Programming lab
C Programming labC Programming lab
C Programming lab
 
famous placement papers
famous placement papersfamous placement papers
famous placement papers
 
New microsoft office word document (3)
New microsoft office word document (3)New microsoft office word document (3)
New microsoft office word document (3)
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 

C mcq practice test 1

  • 1. For more MCQ Question visit www.csemcq.com Q1. If an integer need 2 bytes of storage then the maximum value of an signed integer is: a) 216 -1 b) 215 -1 c) 216 d) 215 Ans b Explanation: In signed magnitude form one bit is used to store the sign so only 15 bits are available to store the value. Q2. If cse is an input then the following program fragment results in Char x,y,z; Printf(“%d”,scanf(“%c”, “%c”, “%c”,&x,&y,&z)); results in a) Syntax error b) A fatal error c) Segmentation violation d) Printing of 3 Ans d Explanation: Scanf() function returns number of successful matches I.e. 3 in this case Q3 The statement printf(“%d”,sizeof(“”)); prints a) An error message b) 0 c) garbage d) 1 Ans d Q4 The following program fragment: if (a=5) printf(“a is five”); else printf(“a is not five”); result in the printing of a) a is five b) a is not five c) nothing d) garbage ans a q5 main()
  • 2. For more MCQ Question visit www.csemcq.com { Int i=5; i=(++i)/(i++); printf(“%d”,i); } prints: a) 2 b) 5 c) 1 d) 6 Ans a Q6 The statement printf(“%d”,10?0?5:11:12); prints: a) 10 b) 0 c) 12 d) 11 Ans d Q7 if you are using “open” function for opening a file the file handle should be of--------type a)FILE b) int c) char d)none of the above ans a; Q8 What will be the output of following program: #define ISLOWER(a)(a>=97&&a<=127) #define TOUPPER(a)(a=a-32) int main() { char ch=’c’; if(ISLOWER(ch)) ch=TOUPPER(ch); printf(“%c”,ch); } Ans a)C b)c c)99 d) None of the above Q9. Find the output of program: int main() { int i;
  • 3. For more MCQ Question visit www.csemcq.com for(i=-1;i<=10;i++) { if(i<5) continue; else break; printf("gets printed only once"); } } Ans a)No output b) Gets Printed only once c)Error d) None Q10 Find the output of program: int main() { if(printf("C for yourself how it worksn")) getch(); } a) Error b) C for yourself how it works c) none e) C for yourself how it works C for yourself how it works C for yourself how it works C for yourself how it works ---------------------------------- Ans b