69 765
Assignments Done
99,6%
Successfully Done
In February 2019

Questions: 277

Free Answers by our Experts: 200

Ask Your question

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

I want to write a program that finds prime numbers using a sieve of Eratosthenes method.
I must use (variable length array) vom Typ bool.
I wrote the following code, but unfortunately it does not work.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

int main()
{ int n,i;

printf("Enter the limit: ");
scanf("%d",&n);
int size = sizeof(A)/ sizeof(n);

prim(A,size);

for(i=2;i<n;i++)
{
if(A[i])
{
printf("\n%d",i);
}
}

return 0;
}
bool prim(int* A, int size)
{
int i,j;
for(i=2;i<n;i++)
A[i] = true;


for(i=2;i<n;i++)
{
for(j=i;i*j<n;j++)
{
A[i*j] = false;
}
}
}
can you help me please?
• Create or find 3 files containing C programs such as the one given below
#include <stdio.h>
struct time {
int hour,min;
};
typedef struct {
int flightno;
struct time arrival;
}FlightInfo;

void inp(FlightInfo arr[]){
int i;
for (i=0;i<2;i++)
{
printf("Enter flight no and arrival time:");
scanf("%d %d %d",&arr[i].flightno,&arr[i].arrival.hour,&arr[i].arrival.min);}}
void calculateDelay(FlightInfo arr[], int d){
int i,x;
for (i=0;i<2;i++) {
• For the three C programs,
◦ Read the file name from the user and open the file
◦ Read the C program from the text file and find the
▪ number of statements in the program
▪ number of for, while and do-while loops in the program
Output
Sample Run:
Program named “flights.cpp” contains:
53 lines of code
3 for loops
2 while loops
1 do-while loop
Program named “hw.cpp” contains:
45 lines of code
1 for loop
3 while loops
0 do-while loop
Find the average, maximum, minimum, and sum of three numbers given by the user.
I have an assignment where i have to use the malloc function to allocate memory for 2 input strings, problem is whenever i try to print my scanned strings they have unwanted random characters at their end (for example i have 2 string inputs each in new line, being abc and def, when i want to print them it comes out as abc²²²² and def²²²²
write a program that automates operations of the train booking system(booking for routes, showing schedule of the journeys in a given day, show vacant seats on a particular day, you can be able to cancel reservation, able to add a train)
notes on IT definition, objectives, functions and management
write a program that prompts for the name and password for three times of a user. The program displays "congratulations, you are logged in." if the user enters the correct password or "Wrong password.Try Again" for a wrong password on which it displays "Sorry, your account is locked, contact the system administrator" if all the three attempts are wrong. use C programming language
arrays in c programming language and their uses
all functions in c programming language and their uses
a program that accepts date of birth in the order of day,month and year and then displays it in the format: dd/mm/yy separated by a forward slash
Submit
Privacy policy Terms and Conditions