Ask Question, Ask an Expert


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.

Int main()
Int x, y, z;
y=z+ --y/x++;
z+=x*y-- %10;
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++

C program assignmentaccording to C Program Assignment According to

C Program Assignment According to, 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 Δσ ...

Descriptionnbspin this assignment you will write a c

Description:  In this assignment you will write a C++ program that finds the kth largest number among a set of N numbers. It will implement the solution using two different algorithms and measure the time elapsed during ...

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 ...

Discussion questonsplease respond to all of the following

Discussion Questons Please respond to all of the following prompts: • How are input and output accomplished in C++? • How do cin and cout relate to ostream and istream? Lab Activity 1. Write a C++ program per the require ...

Please use codeblockslist the program and the output on the

Please use codeblocks List the program and the output on the command line Eg #include #include using namespace std; int main() { floatjohno = 0.5; size_t size = 24; vector array(size); for(inti=0; i     { johno = johno + ...


Write a C++ program that will use loops to perform each of the following tasks: 1. Ask the user for two characters from the keyboard and read them into char variables. Determine which input is larger and which is smaller ...

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 ...

Programming assignment-1 program specification1 your

Programming Assignment- 1. Program Specification 1. Your program must read 8-bit ASCII strings from standard input -- for instance, using the cin object in C++, or stdin in C. You must consume all input from standard inp ...

This program involves using stl listsfor this program you

This program involves using STL lists. For this program you will implement three functions whose prototypes are given below: list ::iterator mxIter(list ::iterator first, list ::iterator last); void selectSort(list & aLi ...

Object oriented programmingassignmentq1 assuming there are

Object Oriented Programming Assignment Q1: Assuming there are 7.481 gallons in a cubic foot, write a program that asks the user to enter a number of gallons, and then displays the equivalent in cubic feet. Q2: You can co ...

  • 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