Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem1)a) Find the errors in the following program:

# Include
main( )
{
print (‘Learning C is not\n a difficult task’);
return ( );
}

b) If a, b, c are int variables and a - 2, b - 4, c-3, d-5, what is the value of the expression a/b/c*d-a+c*d/b-c. Justify your answer.

c) Which of the following are valid C identifiers?

i) variable name 

ii) 2ndchance

iii) alpha++

iv) Motor-Car

v) register

vi) Saving Account

d) prepare the following operators from lowest to highest precedence:

i) ( ), <, ||, ?, +, *, ++

ii) /, !=, &, -, ~, [], +=

problem2)a) Consider the program

1 #include
2 int main ()
3 {
4 int a;
5 char b;
6 float c;
7 printf ("Enter the values of a, b, c");
8 scanf ("%d%c%f",&a, &b, &c);
9 printf ("%d%c%f",&a,&b,&c);
10 return 0;
11 }

If the input is a-2.5, b-234, c-89, what is the output. describe your answer.

b) What will be the output of the following program? Justify your answer.

#include
Int main()
{
Int x, y, z;
x=10;y=20;z=5;
x=z+y++;
printf("x=%d,y=%d,z=%d\n",x,y,z);
x=10;y=20;z=5;
y=z+ --y/x++;
printf("x=%d,y=%d,z=%d\n",x,y,z);
x=10;y=20;z=5;
z+=x*y-- %10;
printf("x=%d,y=%d,z=%d\n",x,y,z);
x=10;y=20;z=5;
x-=x%z-(x+--z%z);
return 0;
}

c) describe the output of the following C program:

1 # include
2 # include
3 int main ( )
4 {
5 int count;
6 for (count = 1; count <= 100; count ++)
7 i f (pow (floor (sqrt (count + 0.0)), 2) == count)
8 printf ("% d", count);
9 printf ("\n");
10 return 0;
11 }

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92595
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question? 


Related Questions in C/C++

Write a program that calculates mileage reimbursement for a

Write a program that calculates mileage reimbursement for a salesperson at a rate of $0.35 per mile. Your program should interact with the user in this manner: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer re ...

C program assignmentaccording to C Program Assignment According to

C Program Assignment According to http://en.wikipedia.org/wiki/Great-circle_distance, the great circle distance based on two coordinates in nautical miles is given by: d = r * Δσ where r is the radius of the earth and Δσ ...

A write an array implementation of self-adjusting lists in

a. Write an array implementation of self-adjusting lists. In a self-adjusting list, all insertions are performed at the front. A self-adjusting list adds a find operation, and when an element is accessed by a find, it is ...

Write an application that allows the user to enter two

Write an application that allows the user to enter two variables: number (real) and code (character). Calculate the value indicated by the table below: If code is Result A symbol the whole part of the number everything e ...

1 requirementsin this assignment you can unleash your

1. REQUIREMENTS In this assignment, you can unleash your imaginations and use OpenGL with C/C++ programming to produce a scene(s) that represents what you envision could possibly be seen under the sea. Please note that a ...

Computer scienceprogram-write a c program that willpresent

Computer Science Program- Write a C++ program that will: Present the user with a menu of choices: 1. Random number 2. String 3. Type Casting 4. Integer Math Then, in an if-else if structure (or switch) write the code for ...

Assignment simple 5-card poker gamein this assignment you

Assignment: Simple 5-Card Poker Game In this assignment, you will develop a simple poker game, complete with basic AI, using the object oriented programming principles discussed in class. Flow of Play Your poker game's p ...

C program codeoverviewfor this assignment write a program

C++ program code Overview For this assignment, write a program that will simulate a single game of Craps. Craps is a game of chance where a player (the shooter) will roll 2 six-sided dice. The sum of the die will determi ...

Write code to create the generator submit your source code

Write code to create the generator. Submit your source code as well as a description of how I could run the program, sample screenshots of the program in action, and the various changes that could be produced through you ...

Ipo chartinputprocessingoutputmarks for four

IPO Chart Input Processing Output Marks for four courses Processing Item: Grade Point and Grade for individual course Overall GPA Algoritham Initialize gp with zero Repeat  for (each course)                 Enter the mar ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate