View all courses
This Course is designed for the aspiring Web Designers and Developers with a need to understand the HTML in enough detail along with its simple overview, and practical examples.
Read more
CSS is used to control the style of a web document in a simple and easy way.This tutorial will help both students as well as professionals who want to make their websites.
JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complimentary to and integrated with Java.
This tutorial is designed for software programmers who wants to learn the basics of jQuery and its programming concepts in simple and easy ways. This tutorial will give you enough understanding on components of jQuery with suitable examples.
AJAX, is a web development technique for creating interactive web applications. If you know JavaScript, HTML, CSS, and XML, then you need to spend just one hour to start with AJAX.
HTML5 is the latest and most enhanced version of HTML.Technically, HTML is not a programming language, but rather a mark up language.This tutorial has been designed for beginners in HTML5 providing the basic to advanced concepts of the subject.
PHP (Hypertext Preprocessor), it is extensively used by developers for programming and development. PHP has lots of benefits and easy to learn so it is the first choice of developers and programmer.
Many PHP programming courses cover the basics or a specific concept. Our Advanced PHP Development course gives you the concepts, features, tools, and practical advice to use them together to build performant, secure, scalable, and reliable web applications.
In this tutorial we will provide you with detailed instructions on how to use WordPress to create and manage your site. WordPress can be used for both simple and complex websites. In our WordPress tutorial we have tried to cover all the basics and few advanced topics.
This tutorial has been prepared for developers who would like to learn the art of developing websites using CodeIgniter. It provides a complete understanding of this framework.
Zend Framework 1 is an open source framework for developing web applications and services using PHP 5.3+. Zend Framework 1 uses 100% object-oriented code and utilises most of the new features of PHP 5.3.
Zend Framework 2 is an open source Module based framework for developing web applications and services using PHP 5.5+. Zend Framework 1 uses 100% object-oriented code and utilises most of the new features of PHP 5.5
The Language Which does not need any prior knowledge of Programming and Easy to learn .Python is Object-oriented ,interpreted and Server side Scripting language .
In Advance concept After learning Core Python We will use Python to create Desktop Application, Web Application, Sockets Programming , Multithread Programming. Since its An Open source Language its free of Cost
Ruby is server side, dynamic, reflective, object-oriented, general-purpose programming language. Ruby is "an interpreted scripting language for quick and easy object-oriented programming"
Ruby on Rails, or simply Rails, is a web application frameworkwritten in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages.
If you have any confusion then you can ask our experts.Our experts will guide you properly.
We are looking you if you are looking guidance for web design and development. Apply online.
Contact us
< Loops in C Pattern using loop in c >
Level 1: Basic Interview Traps Q1. Increment operator #include <stdio.h>
int main() { int i; for (i = 0; i < 5; i++) { printf("%d ", i); } return 0; }
Show answerOutput 0 1 2 3 4 Explanation: The loop starts at 0 and stops when i becomes 5.
Q2. Decrement operator #include <stdio.h>
int main() { int i; for (i = 5; i > 0; i--) { printf("%d ", i); } return 0; }
Show answerOutput: 5 4 3 2 1 Explanation: The condition i > 0 becomes false when i reaches 0.
Q3. Increment by 2 #include <stdio.h>
int main() { int i; for (i = 1; i <= 10; i += 2) { printf("%d ", i); } return 0; }
Show answerOutput: 1 3 5 7 9 Explanation: i += 2 adds 2 after each iteration.
Q4. Empty initialization and update expressions #include <stdio.h>
int main() { int i = 1; for (; i <= 3;) { printf("%d ", i); i++; } return 0; }
Show answerOutput: 1 2 3 Explanation: All three expressions in a for loop may be omitted or placed elsewhere, provided the logic is handled correctly. Here, initialization and increment happen outside the loop header.
Q5. Multiple variables in a for loop #include <stdio.h>
int main() { int i, j; for (i = 1, j = 5; i <= 3; i++, j--) { printf("%d %d\n", i, j); } return 0; }
Show answerOutput 1 5 2 4 3 3 Explanation: The comma operator allows both variables to be initialized and updated in the same loop header.
Level 2: Tricky Loop Logic Q6. Post-increment inside printf() #include <stdio.h>
int main() { int i = 1; for (; i <= 3;) { printf("%d ", i++); } return 0; }
Show answerOutput: 1 2 3 Explanation: i++ prints the current value first and then increments it.
Q7. Pre-increment in the loop condition #include <stdio.h>
int main() { int i = 0; for (; ++i < 4;) { printf("%d ", i); } return 0; }
Show answerOutput: 1 2 3 Explanation: ++i increments i before checking whether it is less than 4.
Q8. continue statement #include <stdio.h>
int main() { int i; for (i = 1; i <= 5; i++) { if (i == 3) continue; printf("%d ", i); } return 0; }
Show answerQ9. break statement #include <stdio.h>
int main() { int i; for (i = 1; i <= 10; i++) { if (i == 5) break; printf("%d ", i); } return 0; }
Show answerQ10. Nested loops #include <stdio.h>
int main() { int i, j; for (i = 1; i <= 3; i++) { for (j = 1; j <= 2; j++) { printf("%d%d ", i, j); } } return 0; }
Show answerOutput: 11 12 21 22 31 32 Explanation: For each value of i, the inner loop runs twice.
Level 3: Advanced Interview Questions Q11. Changing the loop variable inside the body #include <stdio.h>
int main() { int i; for (i = 1; i <= 5; i++) { printf("%d ", i); i++; } return 0; }
Show answerOutput: 1 3 5 Explanation: i is incremented once inside the body and once by the loop update expression. It therefore increases by 2 per iteration.
Q12. Multiplication in the update expression #include <stdio.h>
int main() { int i; for (i = 1; i < 20; i *= 2) { printf("%d ", i); } return 0; }
Show answerOutput: 1 2 4 8 16 Explanation: The value doubles after every iteration. The next value is 32, which fails the condition i < 20.
Q13. Nested loops with break #include <stdio.h>
int main() { int i, j; for (i = 1; i <= 3; i++) { for (j = 1; j <= 3; j++) { if (j == 2) break; printf("%d%d ", i, j); } } return 0; }
Show answerQ14. Sum calculation #include <stdio.h>
int main() { int i, sum = 0; for (i = 1; i <= 5; i++) { sum += i; printf("%d ", sum); } return 0; }
Show answerQ15. Comma operator in the condition #include <stdio.h>
int main() { int i, j; for (i = 0, j = 5; i < 3, j > 0; i++, j--) { printf("%d %d\n", i, j); } return 0; }
Show answerOutput 0 5 1 4 2 3 3 2 4 1
{{questionlistdata.blog_question_description}}
{{answer.blog_answer_description }}