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 in which you will:
1. Prompt user to enter values the following variables: an integer, a double, and a character.
2. Create a pointer for each of the variable.
3. Using only the pointers, increase the variables by 1.
4. Print out the value and the address of each variable.
Name your program task1.c
Output of your program should look like this:
hb117@uxb4:~$ gcc -Wall task1.c -o task1
hb117@uxb4:~$ ./task1
Please enter an integer, a double and a character:
99 1.3 a
100 0x7ffcc9aeaadc
2.300000 0x7ffcc9aeaae0
b 0x7ffcc9aeaadb
hb117@uxb4:~$
ALGORITHM FOR NIM GAME
write a c program to find out number is armstrom or not??
If there is a space to park the vechiles then some n number of vechiles are parked there and then count how many are of cars, and how many of are scooters and note the arrival time and the departure time, display the order of parked vechiles, and the color of vechile,if he wants to take the vehicle from the parking he has to tell the number of vehicle if the number is wrong he can’t able to take the vehicle from parking in that case he has to tell the car model and the color of vehicle and also the rc book of vehicle and also he has to calculate the parking fees based on time he kept.
A game is played with three piles of stones and two players. At her turn, a player removes one or more stones from the piles. However, if she takes stones from more than one pile, she must remove the same number of stones from each of the selected piles.
In other words, the player chooses some N>0 and removes:
• N stones from any single pile; or • N stones from each of any two piles (2N total); or • N stones from each of the three piles (3N total).
Find Σ(xi+yi+zi) where (xi,yi,zi) ranges over the losing configurations with xi ≤ yi ≤ zi ≤ 1000.
write a programe that uses an array to store the marks of 50 students in a class.The program should also calculate and output the sum and average of the marks.
write general syntax of a while sturcture
How to print only one time the statement if a few wrong input is key in:
Eg:
if key in kkk, only will print one statement instead of the example below.
sample output:
Do you wish to try again (Type Y to continue Q to quit:kkk
Error: Invalid choice

Do you wish to try again (Type Y to continue Q to quit:Error: Invalid choice

Do you wish to try again (Type Y to continue Q to quit:Error: Invalid choice

Do you wish to try again (Type Y to continue Q to quit:


//Code
valid=0;
while (valid==0)
{
printf("\nDo you wish to try again (Type Y to continue Q to quit:"); // print statement request for input
scanf(" %c", &choice); // get user input
choice = toupper(choice);
if((choice == 'Y') || (choice == 'Q')) valid= 1;
else printf("Error: Invalid choice\n"); // statement
}
Generate a 2D array of size 20 x 20 comprising 0 or 1 using a RAND generator. Ensure the following: 1- Seed your generator with a different seed (time of the day for instance) each time you re-execute the code. 2- Your 2D array must be symmetric, i.e., corresponds to a valid adjacency matrix. That is, if there is an edge between (i,j) then this means there is an edge between nodes (j,i). So think carefully in generating your 2D matrix.
In a class room everyone is very friendly and has bonded with others in a short span of time. During the exams, students will sit along with their friends and will write the exams, which actually resulted in the finding that only a few members in the batch are good at studies and others are not. After getting several complaints from the staff members, the Principal has agreed to change the sitting pattern during the exams for which she has formed a committee. Using a spy, committee was able to get a list of close friends for all the students in the class. Now using this list they want to identify two groups of people such that a person in one group must not be a friend to any other in the same group. Your task is to help the committee.
LATEST TUTORIALS
APPROVED BY CLIENTS