ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
Why doesn't the code "int a = 1000, b = 1000;
long int c = a * b;" work?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?
Answer
# 1
You must manually cast one of the operands to (long).
 
Is This Answer Correct ?    0 Yes 0 No
Guest
 
  Re: Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?
Answer
# 2
I think mostly we should avoid assigning the variables while
declaring with the variables of another datatype..
 
Is This Answer Correct ?    0 Yes 0 No
Vikraman85
[Anna University!]
 
 
 
  Re: Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?
Answer
# 3
i think, the result exceeds the long int value..

the result is 10 and 6 0s..

and it exceeds the value for the long in

long int is 4 bytes..
the highest value is 65524 (m not very sure.. this could be 
one of the reasons)..
 
Is This Answer Correct ?    0 Yes 0 No
Shruti
 
  Re: Why doesn't the code "int a = 1000, b = 1000; long int c = a * b;" work?
Answer
# 4
this will work.... correctly
 
Is This Answer Correct ?    0 Yes 0 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the maximum no. of bytes calloc can allocate Mphasis2
main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output? Ramco6
1,1,5,17,61,217,?,?.  3
the code is::::: if(condition) printf("hello"); else printf("world"); WHAT WILL BE THE CONDITION IN IF IN SUCH A WAY THAT BOTH HELLO AND WORLD ARE PRINTED IN A SINGLE ATTEMPT?????? SINGLE ATTEMPT IN THE SENSE... IT MUST FIRST PRINT "HELLO" AND IT MUST GO TO ELSE PART AND PRINT "WORLD"..... NO LOOPS, RECURSION ARE ALLOWED........................ IBM7
which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..} TCS2
write a program for odd numbers?  5
what is memory leak?  3
read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX) x=1; else if(x<MIN) x=-1; x=50; if the initial value of x=200,what is the vlaue after executing this code? a.200 b.1 c.-1 d.50 TCS2
WHY DO WE USE A TERMINATOR IN C LANGUAGE?  2
main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); } ME3
C passes By value or By reference? Geometric-Software3
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } what is the output? Ramco6
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output CitiGroup4
Write a program to generate prime factors of a given integer?  1
consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value TCS2
What is the most efficient way to count the number of bits which are set in a value?  2
can anyone please tell me wat is backlogs... i was looking for the job openings where i read this.. eligibility criteria minimum 70% in degree without backlogs. is that arrear.. if so is it standing arrear or history of arrears... please help me...  2
#define d 10+10 main() { printf("%d",d*d); }  2
HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE  1
Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage Accenture4
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com