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                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
print a semicolon using Cprogram without using a semicolon 
any where in the C code in ur program!!

 Question Submitted By :: Solidcube
I also faced this Question!!     Rank Answer Posted By  
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 1
void main()
{
if(printf("semicolon")){}
if(printf(getch())){}
}
 
Is This Answer Correct ?    19 Yes 7 No
Vinay_csjm
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 2
void main()
{
    while(!printf("\nHello World"))
}
 
Is This Answer Correct ?    9 Yes 14 No
Bikash Mazumdar
 
 
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 3
Answer #1 and #2 are wrong. They dont work on Turbo C. If
anybody knows the write answer please email me the code.
 
Is This Answer Correct ?    0 Yes 2 No
Ameya
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 4
#include<stdio.h>
void main()
{char a=';';
if(printf("%c",a)){}
}
 
Is This Answer Correct ?    3 Yes 11 No
Anshu Ranjan
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 5
#include<stdio.h>
void main()
{int a=59;
if(printf("%c",a)){}
}
\\the previous one was wrong
 
Is This Answer Correct ?    2 Yes 6 No
Anshu Ranjan
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 6
#include<stdio.h>
void main()
{
if(printf("%c",59)){}
}
\\actually, this is correct
 
Is This Answer Correct ?    20 Yes 2 No
Anshu Ranjan
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 7
Hey...thanx anshu....
 
Is This Answer Correct ?    1 Yes 0 No
Ameya
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 8
ultimate
 
Is This Answer Correct ?    0 Yes 0 No
Dkp
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 9
void main()
{
if(getche()){}
}
you can input ; at run time and itll be printed on output
screen.
 
Is This Answer Correct ?    4 Yes 1 No
Lakshmi
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 10
main()
{
  if(printf("%c",59))
  {}
}
 
Is This Answer Correct ?    7 Yes 2 No
Muthukumar
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 11
Anshus code is working,tanx
 
Is This Answer Correct ?    1 Yes 0 No
Bharadwaj
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 12
#include<stdio.h>
void main()
{
 while( printf("%c", 59), 0)
 {
 }
}
 
Is This Answer Correct ?    0 Yes 3 No
Poorna
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 13
Does anyone know why its working??

("%c", 59)???

because 59 is the ascii value for a semicolon..

hence we are printing a character against a number..

This was juss as little information..
few may get confused.. :-)
 
Is This Answer Correct ?    5 Yes 2 No
Shruti
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 14
#include<stdio.h>
void main()
{
 while( printf("%c", 59), 0)
 {
 }
}
 
Is This Answer Correct ?    0 Yes 7 No
Narasimha Peruru
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 15
int main()
{
 if(hellow world){}
}
 
Is This Answer Correct ?    2 Yes 5 No
Rekha
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 16
main()
{
if(printf(";"))
{
}
}
 
Is This Answer Correct ?    4 Yes 4 No
Ravi
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 17
#include<iostream>

using namespace std;

int main() {

    cout <<  char(59) << endl;

}
 
Is This Answer Correct ?    0 Yes 2 No
Ceeemor
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 18
#include<stdio.h>
void main()
{
if(printf("semicolon")){}
if(getch()){}
}
this will print the word 'semicolon'
 
Is This Answer Correct ?    1 Yes 0 No
Rakesh
 
  Re: print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
Answer
# 19
#include<stdio.h>
#include<conio.h>
void main()
{
if(printf("%c",59)){}
if(getch()){}
}
this is the perfect solution...
 
Is This Answer Correct ?    0 Yes 0 No
Arunabha
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }  1
String copy logic in one line. NetApp9
main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }  1
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }  1
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.  5
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }  1
main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }  1
main() { int i=5,j=6,z; printf("%d",i+++j); }  1
main() { int c=- -2; printf("c=%d",c); }  1
main() { int i=400,j=300; printf("%d..%d"); }  1
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all. Microsoft2
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }  1
void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }  1
main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }  1
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }  1
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }  1
how can u draw a rectangle in C Wipro31
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }  1
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000 HCL1
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }  1
 
For more C Code 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