Can we shutdown the PC using C program if yes please help me?
Yes, you can.
Inside your c program just call the "system(your_commnad)" .
Remember you have to run this program as supper user.
For example.
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Going to shutdown the system....\n");
/*
It will execute the "shutdown" command from the c program.
You can provide "poweroff" in the place of "shutdown".
To know more about system(), do a <man 3 system>.
*/
system("shutdown -P now"); // see man shutdown for more options.
}
Given an array of integers (possibly some of the elements negative), write a C program to find out the *maximum product* possible by adding 'n' consecutive integers in the array, n <= ARRAY_SIZE.
Also give where in the array this sequence of n integers starts.