Untitled

 avatar
unknown
c_cpp
8 days ago
529 B
2
Indexable
// Online C compiler to run C program online
#include <stdio.h>

nodo_t* manipolaLista(nodo_t* l)
{
    if(l == NULL || l->next == NULL)
    {
        return l;
    }
    
    nodo_t *curr = l->next;
    int prev = l->num;
    
    int temp;
    
    while(curr)
    {
        temp = curr -> num;
        
        curr -> num = prev * curr->num;
        
        prev = temp;
        
        curr = curr -> next;
    }
    
    return l;
}

int main() {
    // Write C code here
    printf("Try programiz.pro");

    return 0;
}
Leave a Comment