C Saved Program: calm-life

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


#include <stdio.h>

void main() {
   int a[6];
   int x=0;
   int i;
   int b[6];
   for(i=0;i<6;i++)
   {
       scanf("%d",&a[i]);
   }
   for(i=0;i<6;i++)
   {
       x=x+a[i];
   }
   for(i=0;i<6;i++)
   {
       if(i!=0)
       {
           b[i]=a[i]-a[i-1];
       }
       else
       {
           b[i]=a[i];
       }
   }
   for(i=0;i<6;i++)
   {
       printf("%d",b[i]);
   }
   printf("%d",x);

}

Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs