Is it possible to print a name without using commas, double quotes,semi-colons?

Answers were Sorted based on User's Feedback



Is it possible to print a name without using commas, double quotes,semi-colons?..

Answer / vinay

void main()
{
char s[30]=
{72,69,76,76,79,33,32,84,72,73,83,32,73,83,32,86,73,78,65,89,32,83,65,76,76,65};
if(printf(s));
getch();
}

Is This Answer Correct ?    7 Yes 2 No

Is it possible to print a name without using commas, double quotes,semi-colons?..

Answer / vinay salla

Explanation for above solution:
The answer is based on the ascii values..
We can take the ascii values of the characters together in
one char array..

Is This Answer Correct ?    3 Yes 2 No

Is it possible to print a name without using commas, double quotes,semi-colons?..

Answer / pavan_mustyala

int main(int argc, char* argv[])
{
if(putchar('n') && putchar('a') && putchar('m') &&
putchar('e'))
{

}
return 0;
}

Is This Answer Correct ?    3 Yes 2 No

Is it possible to print a name without using commas, double quotes,semi-colons?..

Answer / saravanan

#include<stdio.h>
#define fun(x) #x

int main()
{
if(printf(fun(INDIA))){}
}

Is This Answer Correct ?    1 Yes 0 No

Is it possible to print a name without using commas, double quotes,semi-colons?..

Answer / srsabariselvan

void main()
{
if(printf("www.sslogic.blogspot.com"))
{
}
}

Is This Answer Correct ?    2 Yes 6 No

Is it possible to print a name without using commas, double quotes,semi-colons?..

Answer / amit rathi

main ()
{
if (printf (hello))
return 0;
}

//printf returns number of characters printed so if
condition turns true.
same can be done with while,shitch,etc.

Is This Answer Correct ?    14 Yes 23 No

Is it possible to print a name without using commas, double quotes,semi-colons?..

Answer / ayub

yes it is possible the code as follow:


#include<stdio.h>
#include<conio.h>

void main()
{

if(printf(Ayub))

return 0;
getch();
}

Is This Answer Correct ?    5 Yes 15 No

Post New Answer

More C Code Interview Questions

void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }

3 Answers  


Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.

5 Answers   IITR, Microsoft, Nike,


main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above

3 Answers   BrickRed, HCL,


Write a routine to implement the polymarker function

0 Answers   TCS,


main() { 41printf("%p",main); }8

1 Answers  






main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above

4 Answers   Corporate Society, HCL,


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


How to palindrom string in c language?

6 Answers   Google,


Implement a t9 mobile dictionary. (Give code with explanation )

1 Answers   Amazon, Peak6, Yahoo,


Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

1 Answers  


Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 Answers  


What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }

1 Answers  


Categories