Programming_Questions_and_Solutions
Programming_Questions_and_Solutions
An array is a collection of elements of the same data type stored at contiguous memory locations.
- Initialization:
int matrix[2][3] = {
{1, 2, 3},
{4, 5, 6}
};
#include <stdio.h>
int main() {
scanf("%d", &n);
scanf("%d", &arr[i]);
largest = smallest = arr[0];
largest = arr[i];
smallest = arr[i];
return 0;
#include <stdio.h>
int main() {
scanf("%d", &matrix[i][j]);
int sum = 0;
return 0;
Q4. What is a Pointer? Write a C Program to Perform Arithmetic Operations Using Pointers
Pointers are variables that store the memory address of another variable.
#include <stdio.h>
int main() {
p1 = &a;
p2 = &b;
return 0;
Q5. Explain the Relationship Between Array and Pointer and Write a C Program to Find Sum of
#include <stdio.h>
int main() {
scanf("%d", &n);
scanf("%d", &arr[i]);
ptr = arr;
return 0;
#include <stdio.h>
int factorial(int n) {
if(n == 0 || n == 1)
return 1;
}
int main() {
int n;
scanf("%d", &n);
return 0;
Q7. Write a C Program to Find nth Term of Fibonacci Series Using Recursion
#include <stdio.h>
int fibonacci(int n) {
if(n == 0)
return 0;
if(n == 1)
return 1;
int main() {
int n;
scanf("%d", &n);
return 0;
one name.
#include <stdio.h>
struct Employee {
int id;
char name[50];
float salary;
};
int main() {
scanf("%d", &emp.id);
scanf("%s", emp.name);
scanf("%f", &emp.salary);
printf("\nEmployee Details:\n");
return 0;