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

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,


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.

6 Answers   Fusion Systems GmbH,


Write a program that reads a dynamic array of 40 integers and displays only even integers

2 Answers  


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


program to find magic aquare using array

4 Answers   HCL,






which function is used to clear the buffer stream on gcc? for example: I wrote following code on gcc #include<stdio.h> int main(void) { char ch; int a,b; printf("\nenter two numbers:\t"); scanf("%d%d",&a,&b); printf("enter number is %d and %d",a,b); printf("\nentercharacter:\t"); scanf("%c",&ch); printf("enter character is %c",ch); return 0; } in above progarm ch could not be scan. why?plz tell me solution.

2 Answers  


&#8206;#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  


main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

1 Answers  


void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above

2 Answers   HCL,


main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }

1 Answers  


Cau u say the output....?

1 Answers  


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


Categories