Are there any problems with performing mathematical operations on different variable types?



Are there any problems with performing mathematical operations on different variable types?..

Answer / Virendra Kumar Singh

Yes, there are issues when performing mathematical operations on variables of different types in C. For instance, if you add an integer and a float, the integer will be promoted to float, which might lead to unexpected results. To avoid such errors, it's best to ensure that all variables involved in the operation are of the same type.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Why n++ execute faster than n+1 ?

3 Answers  


Is it cc or c in a letter?

1 Answers  


Can a local variable be volatile in c?

1 Answers  


main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?

7 Answers   Ramco,


Is c is a middle level language?

1 Answers  


what is the need for main function in c?

5 Answers  


What do you mean by command line argument?

1 Answers   TCS,


The C language terminator is a.semicolon b.colon c.period d.exclamation mark

6 Answers   TCS,


3.write a simple program that will output your name,phone number,e-mail address,and academic major on separate lines 1.create an account and a personal directory for your work b.find out how to create a subdirectory on your system.create one called info c.you will use a text editor to type in your programs and data files.some C systems have a built in text editor;others do not.Find out what text editor you will be using and how to access it.create a text file(not a program) containing your name ,address,and telephone number on separate lines.Next,write the brand of computer you are using and the name of the text editor.Then write a paragraph that describes your past experience with computers.save this file in your info directory. d. find out how to print a file on your system .print out and turn in the file you created in (c).

0 Answers   TCS,


What is "Duff's Device"?

1 Answers   Celstream,


Why do we need functions in c?

1 Answers  


Differentiate between null and void pointers.

0 Answers   TCS,


Categories