Don’t worry, unlock all articles / blogs on PrepInsta by just simply logging in on our website
Type atleast 3 characters
Popular Searches
Trending Pages
Notifications Mark All Read
Test Notification
Walmart is Hiring for 2024 and 2025! Batches Click here to apply!
PREPINSTA PRIME BIG BILLION SALE is live now. Go and grab the amazing offer.
asdasd
You have purchased Zoho Prime Mock Materials go to My Orders
You have purchased CTS Prime Mock Material. go to My Orders
TCS Menu9>
PREPINSTA PRIME
Get Hiring Updates right in your inbox from PrepInsta
Home > TCS Home > TCS Programming Logic Questions > TCS Programming Logic Loops Questions and Answers > TCS Loops Questions Quiz-1
Question 1
The output of the code below is #include <stdio.h> void main() { int a = 5; if (true); printf(“hello”); }
It will display hello
It will throw an error
No Output
Depends on Compiler
Start
Question 2
The output of the code below is #include <stdio.h> void main() { int a = 0; if (a == 0) printf(“hi”); else printf(“how are u”); printf(“hello”); }
hi
how are you
hello
hihello
Question 3
break
exit(0)
abort()
all of the mentioned
Question 4
a) for (i = 0; i < n; i++) for (j = 0; j < n; j += 5)
for (i = 0, j = 0;i < n, j < n; i++, j += 5)
for (i = 0; i < n;i++){}
for (j = 0; j < n;j += 5){}
Question 5
for (i = n; i>0; i–)
for (i = n; i >= 0; i–)
for (i = n-1; i>0; i–)
for (i = n-1; i>-1; i–)
Question 6
The output of this C code is? #include <stdio.h> void main() { int x = 0; for (x < 3; x++) printf(“Hello”); }
Compile time error
Hello is printed thrice
Nothing
Varies
Question 7
The output of this C code is? #include <stdio.h> void main() { double x = 0; for (x = 0.0; x < 3.0; x++) printf(“Hello”); }
Run time error
Hello is printed twice
Hello is printed infinitely
Question 8
The output of this C code is? #include <stdio.h> int main() { do printf(“Inside while loop “); while (0); printf(“Outside loop\n”); }
Inside while loop
Inside while loop Outside loop
Outside loop
Infinite loop
Question 9
The output of this C code is? #include <stdio.h> int main() { int i = 0; do { i++; printf(“Inside while loop\n”); } while (i < 3); }
Outside while loop
Depends on the compiler
Question 10
Variable
Function
typedef
macros
Please login to report
Buy TCS Prog. Logic (C MCQ) Paid Materials
Join TCS Online Classes
Login/Signup
Personalized Analytics only Availble for Logged in users
Analytics below shows your performance in various Mocks on PrepInsta
Your average Analytics for this Quiz
Rank
-
Percentile
0%
Get over 200+ Courses under One Subscription
One Subscription access everything
Get Access to PrepInsta Prime
from FAANG/IITs/TOP MNC's
Don’t settle Learn from the Best with PrepInsta Prime Subscription
Trained 3.2L+ students
Trained 35k+ students
Trained 83k+ students
Trained 46k+ students
The new cool way of learning and upskilling -
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.
Login/Signup to comment
August 7, 2019