I want to convert a Linked List into a reversed integer number
For eg:
LinkedList: 3-> 4-> 2
Output: 243
Eg2:
LinkedList: 5-> 6-> 4
Output: 465
LAYOUT CODE:
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
typedef struct Node{
int val;
struct Node *next;
}node;
int getCount(node* head){
}
int getNumber(node* ptr,int size){
}
int main(){
struct Node * head;
struct Node * second;
struct Node * third;
head = (node*) malloc(sizeof(node));
second = (node*) malloc(sizeof(node));
third = (node*) malloc(sizeof(node));
head->val = 2; head->next = second;
second->val = 4; second->next = third;
third->val = 6; third->next = NULL;
printf("%d",getNumber(head,3));
return 0;
}