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
< Pointer Arithmetic in C Dynamic memory allocation >
Advanced practice problems and solutions on Pointer Arithmetic in C
1. Pointer Traversal with Offset Problem: Print array elements using pointer arithmetic (no indexing). int arr[] = {10, 20, 30, 40, 50}; Solution: #include <stdio.h> int main() { int arr[] = {10, 20, 30, 40, 50}; int *ptr = arr;
for(int i = 0; i < 5; i++) { printf("%d ", *(ptr + i)); } return 0; } *(ptr + i) accesses elements without arr[i].
2. Reverse Array Using Pointer Arithmetic Problem: Print array in reverse using pointers. Solution: #include <stdio.h> int main() { int arr[] = {1, 2, 3, 4, 5}; int *ptr = arr + 4;
for(int i = 0; i < 5; i++) { printf("%d ", *(ptr - i)); } return 0; } Start from last element and move backward.
3. Swap Two Numbers Using Pointers Problem: Swap values without using a third variable pointer. Solution: #include <stdio.h> int main() { int a = 5, b = 10; int *p1 = &a, *p2 = &b; *p1 = *p1 + *p2; *p2 = *p1 - *p2; *p1 = *p1 - *p2;
printf("a=%d b=%d", a, b); return 0; } 4. Pointer Difference Problem: Find number of elements between two pointers. Solution: #include <stdio.h> int main() { int arr[] = {10, 20, 30, 40, 50}; int *p1 = &arr[1]; int *p2 = &arr[4];
printf("%ld", p2 - p1); return 0; } Output: 3 (difference in elements, not bytes)
5. Sum of Array Using Pointer Arithmetic Problem: Calculate sum using pointers only. Solution: #include <stdio.h> int main() { int arr[] = {1, 2, 3, 4, 5}; int *ptr = arr; int sum = 0;
for(int i = 0; i < 5; i++) { sum += *(ptr + i); } printf("Sum = %d", sum); return 0; } 6. Double Pointer Arithmetic Problem: Access values using double pointer. Solution: #include <stdio.h> int main() { int x = 10; int *p = &x; int **pp = &p; printf("%d", **pp); return 0; } **pp gives actual value.
7. Pointer Increment Trick Problem: Predict output. int arr[] = {5, 10, 15}; int *p = arr; printf("%d %d %d", *p, *p++, *++p); Solution: Output may vary (undefined behavior in C). Reason: Multiple increments in same expression → compiler-dependent.
8. Traversing 2D Array with Pointer Arithmetic Problem: Print 2D array using pointers. Solution: #include <stdio.h> int main() { int arr[2][3] = {{1,2,3},{4,5,6}}; int *ptr = &arr[0][0]; for(int i = 0; i < 6; i++) { printf("%d ", *(ptr + i)); } return 0; } 2D array stored in contiguous memory.
9. Pointer to Array vs Array of Pointers Problem: Access elements using pointer to array. Solution: #include <stdio.h> int main() { int arr[3] = {10, 20, 30}; int (*p)[3] = &arr; for(int i = 0; i < 3; i++) { printf("%d ", (*p)[i]); } return 0; } (*p)[i] is required syntax.
10. String Traversal Using Pointer Problem: Print string using pointer increment. Solution: #include <stdio.h> int main() { char str[] = "HELLO"; char *ptr = str; while(*ptr != '\0') { printf("%c ", *ptr); ptr++; } return 0; }
{{questionlistdata.blog_question_description}}
{{answer.blog_answer_description }}