write Write a program with all necessery functions that will read integer values
ID: 671746 • Letter: W
Question
write Write a program with all necessery functions that will read integer values from an input filed the program that then will check the value if the value is divisible by 7it will incert it in singal link first point to by single and it that value were divisible by 5 it will also be inserted in the double linked list double otyhhewise the insteger value will be started in an array called left over you should also find out how many of those intergy value are in singal double and left over then derermine which has the gratest amount of integer values .maha sure include a functiontaht will [print all the valus in singal double and lapoverExplanation / Answer
#include<iostream.h>
struct node
{
int data;
struct node *next;
}*head;
void add( int num )
{
struct node *temp;
temp=(struct node *)malloc(sizeof(struct node));
temp->data=num;
if (head== NULL)
{
head=temp;
head->next=NULL;
}
else
{
temp->next=head;
head=temp;
}
}
void main()
{
int cc=0,i,num MyArray[] = {12,45,66,77,33,44,22,99,10,11};
int LeftOverArray[10];
struct node *n;
head=NULL;
for(i=0;i<10;i++)
{
if(a[i]%7==0)
{
add(a[i]);
}
else
{
LetfOverArray[cc]=a[i];
cc++;
} }
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.