Question
Briefly discuss the relation between pointers and arrays, giving suitable example. Write a program in C, to print transpose of a 2D matrix entered by a user. Also give comments.
Pointers and arrays have a close relationship in the C programming language. In fact, arrays can be thought of as a kind of pointer.
An array is a contiguous block of memory that stores multiple elements of the same data type. The elements in an array are accessed using an index that represents their position within the array. When an array is declared, the name of the array acts as a constant pointer to the first element of the array.
Pointers, on the other hand, are variables that store memory addresses. They can point to the address of another variable or object. In the case of arrays, a pointer can be used to access elements of the array.
To illustrate the relationship between pointers and arrays, let's consider an example:
#include <stdio.h>
int main() {
int arr[5] = {1, 2, 3, 4, 5};
int *ptr = arr; // Assigning the address of the first element to the pointer
printf("Array elements using array syntax:\n");
_____ __ ___________ ______ _____ _________ _____.
________ __________ __________ ___________ ____ __________.
__________ ___ _______ ___________ _______ ___________ __ _____ ___________ ___________ __________.
____ _____ ____ ______ ______ ___________ ________ ___________.
______ ________ _____ __________ __________ _____________ ___________ ________ __________ _______ _______ ____________ _____________ _____ _____________.
__ ___________ _________ ___ _____________ ______ ___ _____ _____________ __ ___________ ____________ ____ _________ __.
__ ________ ________ _________ __ _____________ ___________ _____.
__ ____________ __________ __ _________ _____________ ____________.
____________ ___________ _______ ____________ _____ ____________ ____ _________ ____ ________ ______.
__________ ______ ___________ _____ ____ ____ __ ____________.
____________ ____ ______ ___________ ___ ______ ___ ____________.
____________ ____ ____________ ______ ___ _____________ ____ _____ ____________ _____ ______ _____________ _____.
_________ ___________ ________ __ __________ ___ ______ _____________ ________ __________ _________ ____________.
_____ __________ __ _____ ____ ______ ___________ ___ ____ ___ ___ _________ _____ ________ __________.
________ _________ _________ _________ _____ __.
_____ _____________ ______ __ ___ ____ ______.
_________ ____ ____ _______ ____________ __ ________ ___ ___________ _____________ _________ ______ ______.
___________ _______ __ ____ __________ _______ ____ ___________ _____ __________ _____________ _____________ ___.
_______ _____________ ____ ________ ____ ____ __ __________ ____ _____.
_____ _____________ _________ ____________ _______ _____ __________ ____ _____ ________ ________ ______.
_______ _____ ___ ______ _________ _________ _____________ ____ _______ _________.
____________ __________ ____________ _____________ _______ _______ ________ ________ _______.
___ ________ _____________ __ _____ ___ _____________ ___ _________ _________ _____ _____ __________ ______.
__ ___________ ________ ____ __________ ________ __________ ____________ __ __ ___________ ________ ____________.
___________ _______ ____________ ______ _______ _______ ____ ______ _____________ _____.
_____________ __ __ ___ _____________ _____ _____________ ___ _____________ __ __ ____.
________ ____________ ________ __ __ _________.
__ ____ _____ ___________ _____ ___.
___ _____ ________ _____ ________ ______ ___ ___________ ________.
________ __ _____ _________ ____________ __________ ____ ________ __ _____________ ______ _____.
__________ _____________ ________ ____ _______ _____ _____.
_______ ____________ ______ ________ ___ ____ ______ __ _________ __ ____________ _______.
______ ________ ________ _______ ________ _________ ____.
___________ ____ _____ __________ ________ ___________ ______ _______ _____________ __________ _____________ ____________ ________.
_____________ _______ _____________ ________ _____________ ___________ _____ ___ _____________ ______ ____ ___________ ____ ______ __.
__________ __________ _____ _____ _________ ______ ___________.
_______ __ ____________ ___________ _____ ___________ __________ _______ _________.
________ ___ _____________ ___ _________ ______ ________.
___ _________ ____ _________ ________ ______ ____________ ____________ ____ ________ __.
________ _____ _________ __ ____________ ______ ___________ __ ___ ______ _____________ __________ _____________.
___ __ _________ ___________ ________ _________ ___________ ___ __ __________ ______ __ _______ ___________ _____.
__________ __ ____ ___ __________ _____________ ______ _________.
______ ____ __ _____ _____________ _____ ____ ________ ____ __ ____________ ___ ___ _________.
_________ _________ _________ ___ __ _____________ __ ________ __ __________ __ _________.
___________ ___ _________ ___________ ______ ____________ _______ ______ __________ ____ _______ ____ _____________ _______ _____.
____________ __ __ __________ ____ _________ ____ ___________ ___ ____.
__________ ___________ _______ __ ________ ____ __________ ______ ___________ _____________ _____ ___ ______ ______ _____________.
_________ _____ ______ ________ _________ ____ ____________ ____________ ________ ________ _______ _____________ ______.
___________ _______ __________ ___________ _____ ______ ____ ____ __ __ ____________.
_______ _______ ____________ ______ ____ ________ ___ ______ ____ _____________ ________ ____.
___________ _________ ____ ____________ __ _____________ ____ ___________ _______ ___ ______ _______ ________ ______ ____________.
__________ ______ __________ _______ ____ _____ _____________.
__________ __________ __ _____________ ________ _____________ __________ _____________ __________ __ ______ __________ __.
_____ _________ ____________ ________ ____________ ____________ _______ _______ _____________ ___________ ____ ______.
_______ __ _________ ___________ ____ ___________ ___ _________ __ __ _______.
______ ___________ _________ _____________ ________ ________ _____ ________ _____________ _______ ____________ ____ ________ ________ ____________.
____________ __ ___________ ____________ ________ ______.
_____ _________ _______ _________ _____ __ _____ ___________.
_____ ______ _____________ ________ _________ ________ ___ _________ _________ _____________ ____ ____ ______.
______ _______ ______ ____ ____________ ________ _________.
________ ____________ _____ ________ _________ ______ __________ ______ _____________ __________ __ __________ _____________ ___________.
___ _______ _____ _____ ______ ___________ _____ ____________ _______ _____________ _____ _________ ____.
__________ __ ____ ______ ____________ __________ __________ ________ ____________ _____________ __________ __ _____________ __________.
__________ ____________ __ _______ _____________ ____ _____________ ___________ ____ ________ _____________ __________ ___ ______ ____________.
___ ___________ ___________ _____ ______ ___________ ___.
____.
Click Here to Order Full Assignment on WhatsApp
What is C-Python ? Briefly discuss the relation between framework, library, package and module in Python.
Creating a file and add content to it
Dictionary
Compare flowchart and algorithm. Write Algorithm and also draw flowchart to perform following:
a. Find factorial of a number entered by user.
b. Print Fibonacci series up to the number of terms entered by the uses
Differentiate between the following with the help of suitable example for each :
a. Co-routines and subroutines
b. Co-routines and threads
Differentiate between Random access and Sequential access of files in C. Discuss the syntax and role of fseek( ) and rewind( ) function, while accessing any file.
Differentiate between Random access and Sequential access of files in C. Discuss the syntax and role of fseek( ) and rewind( ) function, while accessing any file.
Click to Contact Us
Call - 9199852182 Call - 9852900088 myabhasolutions@gmail.com WhatsApp - 9852900088