Accept Array elements

#include<stdio.h> void main() { int arr[10], i, j, k, size; printf(“\nEnter array size : “); scanf(“%d”, &size); printf(“\nAccept Numbers : \n”); for (i = 0; i < size; i++) { printf(“Data [%d]: “,i+1); scanf(“%d”, &arr[i]); } printf(“\nThe Array is : “); for (i = 0; i < size; i++) printf(“%d “, arr[i]); getch(); }

Read More

Basics of C Programming

What Is C? C is a highly flexible and adaptable language. Since its creation in 1970, it’s been used for a wide variety of programs including firmware for micro-controllers, operating systems, applications, and graphics programming. When was C developed? C was developed at Bell Laboratories in 1972 by Dennis Ritchie along with Ken Thompson. Many […]

Read More

Find the maximum length of the sub-array in increasing order.

For example we have an array {5,4,6,-2,-1,0,1,9}. The biggest sub-array in increasing order is: {-2,-1,0,1,9}. So the length is 5. #include<stdio.h> void main () { int arr[8] = {5,4,6,-2,-1,0,1,9},i,arrn[8],count=1,j=0,max; printf(“The given array is: “); for(i=0;i<8;i++) printf(” %d” ,arr[i]); // printing the actual array – unnecessary step. printf(“\n”); for(i=0;i<7;i++){ if(arr[i]<arr[i+1]) { count++; } else { arrn[j]=count; […]

Read More