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  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
Program to find the absolute value of given integer using
Conditional Operators
 Question Submitted By :: Vaasu
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Program to find the absolute value of given integer using Conditional Operators
Answer
# 1
#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("enter the value of m:");
scanf("%d",&m);
(m>=0?printf("%d",m):printf("%d",-(-m)));
getch();
}
 
Is This Answer Correct ?    2 Yes 7 No
Vignesh1988i
 
  Re: Program to find the absolute value of given integer using Conditional Operators
Answer
# 2
#include <stdio.h>

int main ( int argc, char* argv  [] )
{
	int value = -10;
	printf ("\n%d", ( value >= 0 ) ? value : ~(value)
+1 );
}
 
Is This Answer Correct ?    2 Yes 4 No
Abdur Rab
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Blade logic interview question. 1st round is a written tests with 15 multiple questions from c and c++. All are simple basic question. Like int main () { Int i=65; Return printf(“%c”, i); } 2nd and 3rd round is technical interview. The position for which I was interview was core UNIX and c. Yes it is for system programming. The company has product name blade server. For their server they are creating their own command for their purpose. Example cd command. We can implement it in a c program by using the chdir() function. So the question asks related to PID, fork, pipe, shared memory, signal. Write a program in c which will act as cp command. BladeLogic1
DIFFERNCE BETWEEN THE C++ AND C LANGUAGE? Wipro2
we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?  1
# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(x+2,y-10)); } the output of the program is a.8 b.6 c.7 d.none TCS5
If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5). Microsoft4
a 'c' program to tell that the set of three coordinates lie on a same line Persistent1
When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?  2
study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)++; printf("a=%dn(*p)=%dn",a,*p); } What is printed? A)100,101 B)100,100 C)101,101 D)None of the above Accenture13
What is the output of the following program #include<stdio.h> main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); } ADITI5
What is sparse file?  1
Write a program to compare two strings without using the strcmp() function Accenture14
what is the associativity of bitwise OR operator?  1
How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance  7
how to impliment 2 or more stacks in a single dimensional array ? iFlex1
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........................ IBM9
WAP to accept rollno,course name & marks of a student & display grade if total marks is above 200?  2
prototype of sine function. Cadence2
is compiler do read the data line by line or not. ?? LG-Soft3
#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared like DCHAR ch1, ch2; TCHAR ch3, ch4; then what will be types of ch1, ch2, ch3 and ch4? NDS1
what is difference between array and structure? TCS19
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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