C Answers

Questions answered by Experts: 1 680

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

Write a C program to read 1 integer input from user. Multiply 3 to the input, convert the result to string and print the result.
Write a C program to read 1 integer input and 1 float input from user. With the inputs, calculate the quotient and print it to screen.
Kesa has changed RS as per unit consumption is one month as per the following condition-

1) unit>=200-> 0.50 paise/unit

2) unit>100 and unit <200->0.60 per/unit

3) unit> 50 and unit<100->0.70 per/unit

4) otherwise 0.8 per/unit

Note- 50 RS meter changes will also add.
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.
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
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
a program that uses functions to return the product,sum and modulus of two positive numbers entered by a user.the program should have a dashboard that allows the user to select the computation he wishes to be done.
write a program that prompts for the name and password 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
LATEST TUTORIALS
APPROVED BY CLIENTS