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 not; not=!2; printf("%d",not); }

1 Answers  


#include<stdio.h> int main() { int x=2,y; y=++x*x++*++x; printf("%d",y); } Output for this program is 64. can you explain how this output is come??

1 Answers  


const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above

1 Answers   emc2, HCL,


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 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  






Write a routine to implement the polymarker function

0 Answers   TCS,


¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...

3 Answers  


programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h

1 Answers  


Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


Is this code legal? int *ptr; ptr = (int *) 0x400;

1 Answers  


main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


Categories