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

Assignmentobjectivespractice reading characters from a

Assignment Objectives Practice reading characters from a file Practice using command line input Practice using command-line redirection of files Practice implementing a double transposition ciphering algorithm Summary In ...

Assignmentwhen writing c programs include comments in your

Assignment When writing C++ programs include comments in your code, make the program readable by indenting, use meaningful variable and function names, and produce meaningful output. This assignment will be to write a bm ...

1 three employees in a company are up special pay increase

1. Three employees in a company are up special pay increase. You are given a file, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee ...

Discussionkeyboard versus file input please respond to the

Discussion "Keyboard versus File Input" Please respond to the following: • Suppose you are designing a C++ application that needs to capture user input specifically via a keyboard or from a file. Determine the method tha ...

Assessment taskthis coursework will allow you to

Assessment Task: This coursework will allow you to investigate some of the issues involved in writing threaded programs. You are to write a series of simple programs in C/C++ that will run under Linux, to illustrate how ...

Write a c program that requests the name of any cartoon

Write a C program that requests the name of any cartoon character from the user, then does the following with that name (use printf for each): a. Displays it enclosed in double quotes. b. Displays it in a field 24 charac ...

Design implement test and debug a c program to simulate the

Design, implement, test, and debug a C# program to simulate the rolling of two dice 100 times. Whenever the two dice display the same number, the program should show the roll sequence number (e.g. the 10th roll) and the ...

Assignmentpart acomplete the following questionswrite c

Assignment Part A Complete the following questions: Write C++ code to open a document with the name Hello.txt, place the message "Hello, World!" in the document, and exit the document. Re open the file you closed, and re ...

Write a program to draw a symmetric shape of your own using

Write a program to draw a symmetric shape of your own using C++ user-defined functions and arrays. The program should draw a shape in its original and opposite forms (black and white and then white and black). Please con ...

Assignmentbullwrite the code for each lab

Assignment • Write the code for each lab assignment. • Submit the lab in a single zip file in the online course shell. The lab must contain all .cpp files, along with any additional files that may be necessary for your p ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen