Posts

Showing posts from February, 2024

𝐏𝐨𝐢𝐧𝐭𝐞𝐫𝐬 & Tutorial 13

Image
  What is Pointer? A pointer is a variable that contains the memory address of another variable, where the real data is stored. Declaring Pointing variable Syntax of declaring pointer variable                          data_type *pointer_variable_name;                         int *ptr; There are three position for valid the "*" mark . * As known as Indirection Operator.                         int *ptr;           int * ptr;         int* ptr; Initializing Pointers Once a pointer is declared, the programmer must initialize the pointer, that is, make the pointer point to something. A  pointer variable can be initialize as follows;                     ...

Tutorial 11 & 12

Find the minimum and maximum of sequence of 10 numbers stored in array. #include<stdio.h> int main(){ int numbers[10]={12,15,34,56,87,62,78,90,47,69}; int i, min=numbers[0], max=numbers[0]; for(i=1;i<10;++i){ max=numbers[i]>max?numbers[i]:max; min=numbers[i]<min?numbers[i]:min; } printf("Maximum number is %i\nMinimum number is %i\n", max, min); return 0; } User Entered 10 Numbers #include<stdio.h> int main(){ int numbers[10]; int i, min, max; for(i=0;i<10;++i){ printf("Enter the number : "); scanf("%i", &numbers[i]); } min=numbers[0], max=numbers[0]; for(i=1;i<10;++i){ max=numbers[i]>max?numbers[i]:max; min=numbers[i]<min?numbers[i]:min; } printf("\nMaximum number is %i\nMinimum number is %i\n", max, min); return 0; } Find the total and average of a sequence of 10 numbers stored in array. #include<stdio.h> int main(){ int numbers[10]; int i; f...