9/24/2014 C Programming- While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher…
http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 1/7
Jobs
Latest
A ds by O ffersWizard A d O ptions
Question 1 WRONG
In while loop after loop
After loop
Compile time error
Infinite loop
Question 2 WRONG
Home > Mock Test > C Programming > C Programming- While Loops | C Programming Interview Questions and
Answers
CProgramming- WhileLoops|CProgrammingInterviewQuestions
andAnswers
C Programming- While Loops
Congratulations - you have completed C Programming- While Loops. You scored 0 out of 15. Your
performance has been rated as Need more practice!
Your answers are highlighted below.
What is the output of this C code?
#include
int main()
{
while ()
printf("In while loop ");
printf("After loopn");
}
What is the output of this C code?
#include
int main()
{
SponsoredLinks
Search YourJobs
Social
Search
25th September 2014 | Thursday Walk-ins in Hyderabad for All Graduates25th September 2014 | Thursday Walk-ins in Delhi, Mumbai for All Graduates
Walkins Software Jobs Freshers Off Campus Govt Jobs TOP MNC Jobs Link Solved Placement Papers Submit Your Resume
9/24/2014 C Programming- While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher…
http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 2/7
In while loop
In while loop after loop
After loop
Infinite loop
Question 3 WRONG
In while loop In while loop In while loop
In while loop In while loop
Depends on the compiler
Compile time error
Question 4 WRONG
2
3
4
do
printf("In while loop ");
while (0);
printf("After loopn");
}
What is the output of this C code?
#include
int main()
{
int i = 0;
do {
i++;
printf("In while loopn");
} while (i < 3);
}
How many times i value is checked in the below code?
#include
int main()
{
int i = 0;
do {
i++;
printf("in while loopn");
} while (i < 3);
}
GetFreeJobUpdates
Followuson Google+
Finduson Facebook
Subscribe to our free & latest job updates by
email.
Enter your e-mail address
Freshershine
35,782 people like Freshershine.
Facebook social plugin
Like
A ds by O ffersWizard A d O ptions
    
Subscribe
FresherShine Jo…
Follow

9/24/2014 C Programming- While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher…
http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 3/7
1
Question 5 WRONG
2
3
4
1
Question 6 WRONG
Compile time error
Hi Hi
Hi
Varies
Question 7 WRONG
How many times i value is checked in the below code?
#include
int main()
{
int i = 0;
while (i < 3)
i++;
printf("In while loopn");
}
What is the output of this C code?
#include
void main()
{
int i = 2;
do
{
printf("Hi");
} while (i < 2)
}
What is the output of this C code?
#include
void main()
{
int i = 0;
while (++i)
{
printf("H");
}
A ds by O ffersWizard A d O ptions
9/24/2014 C Programming- While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher…
http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 4/7
H
H is printed infinite times
Compile time error
Varies
Question 8 WRONG
Nothing
H is printed infinite times
Hello
Run time error
Question 9 WRONG
Nothing
Run time error
Varies
Hello is printed infinite times
}
What is the output of this C code?
#include
void main()
{
int i = 0;
do
{
printf("Hello");
} while (i != 0);
}
What is the output of this C code?
#include
void main()
{
char *str = "";
do
{
printf("hello");
} while (str);
}
A ds by O ffersWizard A d O ptions
9/24/2014 C Programming- While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher…
http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 5/7
Question 10 WRONG
Hi is printed 8 times, hello 7 times and then hi 2 times
Hi is printed 10 times, hello 7 times
Hi is printed once, hello 7 times
Hi is printed once, hello 7 times and then hi 2 times
Question 11 WRONG
for
while
do-while
All of the mentioned
Question 12 WRONG
n, n
n, n+1
n+1, n
n+1, n+1
Question 13 WRONG
What is the output of this C code?
#include
void main()
{
int i = 0;
while (i < 10)
{
i++;
printf("hin");
} while (i < 8)
i++;
printf("hellon");
}
Example of iteration in C.
Number of times while loop condition is tested is, i is initialized to 0 in both
case. while (i < n) i++; ------------- do i++; while (i <= n);
What is the output of this C code?
#include
A ds by O ffersWizard A d O ptions
9/24/2014 C Programming- While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher…
http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 6/7
True (infinite time)
True (1 time) False
False
Compiler dependent
Question 14 WRONG
5, 5
5, 10
10, 10
Syntax error
Question 15 WRONG
for loop
while loop
do-while loop
None of the mentioned
int main()
{
int i = 0;
while (i = 0)
printf("Truen");
printf("Falsen");
}
What is the output of this C code?
#include
int main()
{
int i = 0, j = 0;
while (i < 5, j < 10)
{
i++;
j++;
}
printf("%d, %dn", i, j);
}
Which loop is most suitable to first perform the operation and then test the
condition?
A ds by O ffersWizard A d O ptions
9/24/2014 C Programming- While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher…
http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 7/7
Ad by DeleteAd | Close Ad by DeleteAd | Close
RelatedArticles
C Programming – Sizeof
October 9, 2013
C Programming – Float
Datatype
October 9, 2013
C Programming – Random
Number Generation
October 9, 2013
C Programming – Ungetc
October 9, 2013
C Programming –
Mathematical Functions
October 9, 2013
Share ! Tweet 0 01Like Share
Previous:
Tech Mahindra Placement Paper Fully
Solved-4
« Next:
C Programming- Break and Continue |
C Programming Interview Questions
and Answers
»
© 2014 FresherShine.com     
A ds by O ffersWizard A d O ptions

C programming while loops

  • 1.
    9/24/2014 C Programming-While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher… http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 1/7 Jobs Latest A ds by O ffersWizard A d O ptions Question 1 WRONG In while loop after loop After loop Compile time error Infinite loop Question 2 WRONG Home > Mock Test > C Programming > C Programming- While Loops | C Programming Interview Questions and Answers CProgramming- WhileLoops|CProgrammingInterviewQuestions andAnswers C Programming- While Loops Congratulations - you have completed C Programming- While Loops. You scored 0 out of 15. Your performance has been rated as Need more practice! Your answers are highlighted below. What is the output of this C code? #include int main() { while () printf("In while loop "); printf("After loopn"); } What is the output of this C code? #include int main() { SponsoredLinks Search YourJobs Social Search 25th September 2014 | Thursday Walk-ins in Hyderabad for All Graduates25th September 2014 | Thursday Walk-ins in Delhi, Mumbai for All Graduates Walkins Software Jobs Freshers Off Campus Govt Jobs TOP MNC Jobs Link Solved Placement Papers Submit Your Resume
  • 2.
    9/24/2014 C Programming-While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher… http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 2/7 In while loop In while loop after loop After loop Infinite loop Question 3 WRONG In while loop In while loop In while loop In while loop In while loop Depends on the compiler Compile time error Question 4 WRONG 2 3 4 do printf("In while loop "); while (0); printf("After loopn"); } What is the output of this C code? #include int main() { int i = 0; do { i++; printf("In while loopn"); } while (i < 3); } How many times i value is checked in the below code? #include int main() { int i = 0; do { i++; printf("in while loopn"); } while (i < 3); } GetFreeJobUpdates Followuson Google+ Finduson Facebook Subscribe to our free & latest job updates by email. Enter your e-mail address Freshershine 35,782 people like Freshershine. Facebook social plugin Like A ds by O ffersWizard A d O ptions      Subscribe FresherShine Jo… Follow 
  • 3.
    9/24/2014 C Programming-While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher… http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 3/7 1 Question 5 WRONG 2 3 4 1 Question 6 WRONG Compile time error Hi Hi Hi Varies Question 7 WRONG How many times i value is checked in the below code? #include int main() { int i = 0; while (i < 3) i++; printf("In while loopn"); } What is the output of this C code? #include void main() { int i = 2; do { printf("Hi"); } while (i < 2) } What is the output of this C code? #include void main() { int i = 0; while (++i) { printf("H"); } A ds by O ffersWizard A d O ptions
  • 4.
    9/24/2014 C Programming-While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher… http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 4/7 H H is printed infinite times Compile time error Varies Question 8 WRONG Nothing H is printed infinite times Hello Run time error Question 9 WRONG Nothing Run time error Varies Hello is printed infinite times } What is the output of this C code? #include void main() { int i = 0; do { printf("Hello"); } while (i != 0); } What is the output of this C code? #include void main() { char *str = ""; do { printf("hello"); } while (str); } A ds by O ffersWizard A d O ptions
  • 5.
    9/24/2014 C Programming-While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher… http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 5/7 Question 10 WRONG Hi is printed 8 times, hello 7 times and then hi 2 times Hi is printed 10 times, hello 7 times Hi is printed once, hello 7 times Hi is printed once, hello 7 times and then hi 2 times Question 11 WRONG for while do-while All of the mentioned Question 12 WRONG n, n n, n+1 n+1, n n+1, n+1 Question 13 WRONG What is the output of this C code? #include void main() { int i = 0; while (i < 10) { i++; printf("hin"); } while (i < 8) i++; printf("hellon"); } Example of iteration in C. Number of times while loop condition is tested is, i is initialized to 0 in both case. while (i < n) i++; ------------- do i++; while (i <= n); What is the output of this C code? #include A ds by O ffersWizard A d O ptions
  • 6.
    9/24/2014 C Programming-While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher… http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 6/7 True (infinite time) True (1 time) False False Compiler dependent Question 14 WRONG 5, 5 5, 10 10, 10 Syntax error Question 15 WRONG for loop while loop do-while loop None of the mentioned int main() { int i = 0; while (i = 0) printf("Truen"); printf("Falsen"); } What is the output of this C code? #include int main() { int i = 0, j = 0; while (i < 5, j < 10) { i++; j++; } printf("%d, %dn", i, j); } Which loop is most suitable to first perform the operation and then test the condition? A ds by O ffersWizard A d O ptions
  • 7.
    9/24/2014 C Programming-While Loops | C Programming Interview Questions and Answers | Freshers Jobs | Walkins | Offcampus | Placement Papers | Fresher… http://www.freshershine.com/mock-test/c-programming/c-programming-while-loops-c-programming-interview-questions-and-answers/ 7/7 Ad by DeleteAd | Close Ad by DeleteAd | Close RelatedArticles C Programming – Sizeof October 9, 2013 C Programming – Float Datatype October 9, 2013 C Programming – Random Number Generation October 9, 2013 C Programming – Ungetc October 9, 2013 C Programming – Mathematical Functions October 9, 2013 Share ! Tweet 0 01Like Share Previous: Tech Mahindra Placement Paper Fully Solved-4 « Next: C Programming- Break and Continue | C Programming Interview Questions and Answers » © 2014 FresherShine.com      A ds by O ffersWizard A d O ptions