Click To Get Off-Campus Placement Jobs Info !!!
FREE!!! Latest Nagarro FULL Aptitude Mock Test for Practice
Practice 5+ Mettl Aptitude Mock Test

Floating Point Problems Questions

NA
SHSTTON
6
Solv. Corr.
10
Solv. In. Corr.
16
Attempted
0 M:0 S
Avg. Time

1 / 6

Choose the correct option.

Member function of a class template should be defined


Awithin the class template definition

Boutside class template definition

Ceither (a) or (b)

Din the derived class

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
2
Solv. Corr.
16
Solv. In. Corr.
18
Attempted
0 M:0 S
Avg. Time

2 / 6

What would be the value of c?
#include<stdio.h>
void main()
{ 
int c; 
float a,b;

a= 245.05;
b = 40.02;
c =a+ b;
}

A285.07

B285

C2850

D285

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
9
Solv. Corr.
10
Solv. In. Corr.
19
Attempted
0 M:0 S
Avg. Time

3 / 6

What would be the value of i and k in below C program?
#include<stdio.h>
void main() {
int i,j,k;
j = 5;
i = 2 *j/2;
k = 2 *(j/2);
}

Ai = 5, k = 5

Bi=4,k=4

Ci = 5, k = 4

Di = 4, k = 5

Answer: Option C

Explanation:

at first, glance looks like i value will be 4 and k value will be 4 too. 

but if you see in second statement () has been used. why?

in first statement i = 2 *j/2; three operators have been used i.e = , * , / .
operator = has priority 14 and both operator * & / have priority as 3.
however operator * has high precedence than / so in above statement first multiplication will take place and then division will happen so that i will carry 5. 
Now, in second statement () has been used for j/2. operator () (function call operator has priority 1 and highest precedence in c operator.) so the first j/2 operation will take place and then 2 * result of j/2 (i.e 2). so, k will carry 4. 
An answer will be i = 5 and k = 4.


 


Workspace

NA
SHSTTON
5
Solv. Corr.
14
Solv. In. Corr.
19
Attempted
0 M:0 S
Avg. Time

4 / 6

Choose the correct option.

If a = -11 and b = -3 what is the value of a%b?


A-3

B3

C2

D-2

Answer: Option D

Explanation:

Note: % is a reminder operator in c programming (and programming language). For the remainder operator, the sign of the result is the same as the sign of the dividend.

C define % operator operation for a%b as below:

a = (a/b) * b + a%b

Here dividend is negative so the answer will be -2

Important Points:

=> The answer will be -2 in the scenario where a = -11 and b = 3

=> The answer will be 2 in the scenario when a = 11 and b = -3 or 3



Workspace

NA
SHSTTON
13
Solv. Corr.
24
Solv. In. Corr.
37
Attempted
0 M:0 S
Avg. Time

5 / 6

What is the output of the following 'C' program ?
#include <stdio.h>  
# pragma pack(2)
struct SIZE {
int i;
char ch ;
double db ;
} ;
main ()  {
printf ( "%d\n",sizeof(struct SIZE) );
}

A12

B14

C16

D8

Answer: Option B

Explanation:

Pragma pack instructs the compiler to pack structure members with particular alignment. Most compilers, when you declare a struct, will insert padding between members to ensure that they are aligned to appropriate addresses in memory (usually a multiple of the type's size). This avoids the performance penalty (or outright error) on some architectures associated with accessing variables that are not aligned properly. For example, given 4-byte integers and the following struct:

struct SIZE {

int i;

char ch ;

double db ;

} ;

The compiler could choose to lay the struct out in memory like this:


1 byte

2nd byte
3rd byte
4th byte
int i
 i(1)
i(2)
i(3)
i(4)
char ch
ch(1)
padding
padding
padding
double db

db(1)

db(5)

db(2)

db(6)

db(3)

db(7)

db(4)

db(8)

the size of this structure will be 16.

with pragma pack (1)

1 byte

int i(1)

int i(2)

int i(3)

int i(4)

char ch(1)

double db(1)

.

.

double db(8)

 and the size of strut will be 13.

with pragma pack (2)


1st byte        2nd byte

int i(1)             int i(2)

int i(3)             int i(4)

char ch(1)        double db(1)

.                         .

double db(6)    double db(7)

double db(8)    padding


the size of struct will be 14  (Answer). if pragma pack (4) is given then in 32 bit size of sruct will be 16.

pragma pack tells the compiler the boundary to align objects in a structure to in order to improve access times.

Workspace

NA
SHSTTON
19
Solv. Corr.
55
Solv. In. Corr.
74
Attempted
0 M:0 S
Avg. Time

6 / 6

Choose the correct option.

#include

#define mysizeof(a) (&a+1) - &a
void main()
{
float d;
printf("%d\n", mysizeof(d) );
}
Note: assume sizeof float is 8 bytes


A8

B4

C1

Dcompiler error

Answer: Option C

Explanation:

Tricky ... little bit .. basically in below line &a (address of float variable d) getting subtracted from address of variable + 1 i.e incrementing it with 1 gives the address where the next variable of the type d can be stored, the answer is 1 instead of 8 (as given float size is 8 byte).

#define mysizeof(a) (&a+1) - &a

The difference gives the result that how many variables of type of d can be stored in that amount of memory which will obviously be 1 for the type d. The result of pointer subtraction is in elements and not in bytes. so, that the below expression evaluates to 1. instead of 8.

If you above statement put like below, the answer will be 8.

#define mysizeof(a) (char*)(&a+1) - (char*)&a

typecasting it int char* and taking the difference will tell us how many variables of type char can be stored in the given memory space (the difference). Since each char requires only 1 Byte of memory therefore (amount of memory)/1 will give the number of bytes between two successive memory locations of the type of variable passed on to the macro and hence, the amount of memory that the variable of type d requires i.e 8 bytes.

Workspace


C Programming Floating Point Problems Questions and Answers pdf

At C Programming topic Floating Point Problems page No: 1 you will find list of 10 practice questions, tips/trick and shortcut to solve questions, solved questions, quiz, and download option to download the whole question along with solution as pdf format for offline practice. You can practice all the listed C Programming Floating Point Problems topic questions offline too, by downloading the MCQs practice question of Floating Point Problems with detail solution, with formula/Tips & Tricks, with Solved examples and with top-rated users answers, which will give you best answer ascross webs. It is one of the perfect Floating Point Problems e-book pdf covering all types of questions in detail. These C Programming test with answers pdf cover all types of question asked in IIFT, XAT, SNAP, GRE, GMAT, NMAT, CMAT, MAT or for IT companies written exam like Wipro, HCL, Infosys, Accenture, Government exams, IBPS Exams etc. There are multiple formats to download your online free C Programming Floating Point Problems e-book, like fully solved, unsolved questions with Answers sheet. Even you can customize your ebook format by adjusting the given options in the download section to make it your one of the best C Programming topic-based ebook. It is recommended to bookmark this page C Programming Floating Point Problems for your preparation. Most of the students and fresher candidates finding it hard to clear the C Programming section in exams. Here Given Floating Point Problems practice questions, quiz, fully solved questions, tips & trick and Mock tests, which include question from each topic will help you to excel in Floating Point Problems. Each test has all the basics questions to advanced questions with answer and explanation for your clear understanding, you can download the test result as pdf for further reference.

At C Programming topic Floating Point Problems, you will get multiple online quiz difficulty wise, which will have a total of 6 quizzes, categorized as easy, medium, and moderate level. While preparing for any Floating Point Problems, take all the list quiz and check your preparation level for that topic. Each quiz have 10 different question, which needs to be answered in 20 min., all the listed quiz here is free, however, you will get only one chance for each quiz to attempt(Take Quiz seriously), so it is always recommended to take one quiz in each section before you start solving Floating Point Problems MCQs practice question, and one after solving all the question of the respective level, you can refer back your Floating Point Problems quiz result any time or you can download it as pdf for reference.

C Programming Floating Point Problems Customize Online Mock Test

This is own type of mock test, where At this C Programming Floating Point Problems MCQs mock test section, you will able to attempt only the questions related to Floating Point Problems, in that question will be a different level, important, and all the questions will be part of some of the mock tests across Q4interview FREE Mock test. You need to choose the topic as Floating Point Problems, and click on Double click to generate your customize mock test. While attempting the mock test you need to choose any of the one options out of given option. It is recommended to go through the direction given along with each question, as these questions will be randomly and so that same direction will not be applicable across the entire test. Once you submit your mock test, the result will be generated for Floating Point Problems Customize mock test, where your performance point points will be highlighted. Q4interview analysis every single point which helps you to improve your topic understanding and help you to know your type of mistakes and way to improve Floating Point Problems questions, by providing the same type of practice questions from practice exercise. The best part of this Floating Point Problems, all these mock tests listed here are free and you can take as Many time, as many you want. When you continue to give Floating Point Problems Customize Online Mock Test here regularly, then you will understand how much you have developed your accuracy on a topic, after that you will be able to decide how much attention you need to focus on. Your continued practice will increase your confidence, speed and thinking ability intensely, the Floating Point Problems Customize topic on which you will practice more will beneficial for you in future during campus placement.Floating Point Problems Mock Tests

C Programming Floating Point Problems Quiz Online Test

The details of the C Programming Floating Point Problems quiz are as follows. There are 10 questions for you. You have to answer them in 20 minutes. Within 20 minutes you have to see the errors in the sentences given as a question. Four options are also given to you, and you have to choose your opinion. You must be confident in your answer that the choices are difficult. Therefore, below we provide you with some information about C Programming Floating Point Problems that you see and keep them in mind while answering questions.

C Programming Floating Point Problems MCQs Practice Questions with Answer

On this Floating Point Problems section of page you will find the easiest quickest ways to solve a question, formulas, shortcuts and tips and tricks to solve various easiest methods to solve Floating Point Problems Question Quickly. It contains all the C Programming topic Floating Point Problems questions which are common in any of the preliminary exams of any company. The solution is provided along with the questions. The practice of these questions is a must as they are easy as well as scoring and asked in all the exams They will confirm the selection if all the questions attempted wisely with little practice. It is recommanded to Take Mock test based on C Programming topic and Floating Point Problems topic based quiz.

C Programming Floating Point Problems solved examples question

Clarity of concepts is a must if you want to master the skill of solving C Programming problems. This page contains sample C Programming Floating Point Problems questions and answers for freshers and competitive exams. Floating Point Problems Questions with the detailed description, the explanation will help you to master the topic. Here solved examples with detailed answer description, explanations are given and it would be easy to understand. How to solve qFloating Point ProblemsC Programming? Here are some examples solved with the Common Rules/tricks/tips of C Programming. Enhance your chance to score maximum marks in C Programming sections through. Error Spotting Grammar Questions Online Test for Free. Fully solved Sentence Formation MCQs questions with detailed answer description. C Programming is an important topic for any exams but most aspirants find it difficult. You need to learn various tricks tips, rules, etc to solve quickly. At this page, you will find frequently asked Floating Point Problems questions or problems with solutions, shortcuts, formulas for all-important competitive exams like IT companies exams, interviews. It is always a best practice to go through the example and understand the types of question and way to solve it, so let's do some examples to calculate efficiency, read through all the given here solved examples. You can post your solution, tips, trick and shortcut if you have any in respect to questions.

You can get here fully solved Floating Point Problems examples with a detailed answer and description. You can solve Floating Point Problems problems with solutions, the questions by companies wise by filtering the questions, additionally, you can check what type of questions are being asked in IT companies Written Round from Floating Point Problems. Floating Point Problems became one of the most important sections in the entire competitive exams, Companies Campus, and entrance online test. Go through Floating Point Problems Examples, Floating Point Problems sample questions. You can Evaluate your level of preparation in Floating Point Problems by Taking the Q4Interivew Floating Point Problems Online Mock Test based on most important questions. All the Floating Point Problems practice questions given here along with answers and explanations are absolutely free, you can take any number of time any mock Test.

Why C Programming Floating Point Problems?

In this practice section, you can practice C Programming Questions based on "Floating Point Problems" and improve your skills in order to face the interview, competitive examination, IT companies Written exam, and various other entrance tests (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

Where can I get C Programming Floating Point Problems questions and answers with explanation?

Q4Interview provides you lots of fully solved C Programming (Floating Point Problems) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. You can download C Programming Floating Point Problems quiz questions with answers as PDF files and eBooks.

Where can I get C Programming Floating Point Problems Interview Questions and Answers (objective type, multiple-choice, quiz, solved examples)?

Here you can find objective type C Programming Floating Point Problems questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.