print a "hello" word without using printf n puts in c language

Answers were Sorted based on User's Feedback



print a "hello" word without using printf n puts in c language..

Answer / prince

write(1, "Hello World", 11);

Is This Answer Correct ?    11 Yes 10 No

print a "hello" word without using printf n puts in c language..

Answer / anil h m

#include <stdio.h>
int main() {
char *p = "Welcome to C!
";
long l = 14;
long fd = 1;
long syscall = 1;
long ret = 0;
__asm__ ( "syscall"
: "=a" (ret)
: "a" (syscall),
"D" (fd),
"S" (p),
"d" (l)
);
return 0;
}

Is This Answer Correct ?    0 Yes 2 No

print a "hello" word without using printf n puts in c language..

Answer / taz

ch[6]={'h','e','l','l','o','\0'};
i=0;
do
{
putchar(ch[i]);
i++;
}while(ch[i]!=NULL)

Is This Answer Correct ?    5 Yes 8 No

print a "hello" word without using printf n puts in c language..

Answer / sandeep kumar yadav

fprintf(stdout,"Hello");

Is This Answer Correct ?    11 Yes 15 No

print a "hello" word without using printf n puts in c language..

Answer / ricky

fputs("Hello",stdout)

Is This Answer Correct ?    4 Yes 10 No

print a "hello" word without using printf n puts in c language..

Answer / smith

#include<stdio.h>
#include<string.h>
void main()
{
printf("hello");
puts("hello");
}

Is This Answer Correct ?    3 Yes 23 No

Post New Answer

More C Interview Questions

What's the difference between calloc() and malloc()?

4 Answers  


Which one would you prefer - a macro or a function?

0 Answers  


how to find anagram without using string functions using only loops in c programming

1 Answers   Mind Tree, TCS,


how can i print "hello".please consider inverted commas as well.i want to print on console: "hello"

4 Answers   Wipro,


How can I get the current date or time of day in a c program?

0 Answers  






WHAT IS MAXIMUM SIZE OF AN ARRAY IN C LANGUAGE?

8 Answers   Carphone Warehouse, IBM, SAS,


when user give a number it multiply with 9 without useing '+' and '*' oprator

4 Answers  


why effort estimation is important?

1 Answers  


Are the expressions * ptr ++ and ++ * ptr same?

0 Answers  


What is hungarian notation? Is it worthwhile?

0 Answers  


Explain how does flowchart help in writing a program?

0 Answers  


main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }

11 Answers   CISOC, CitiGroup, College School Exams Tests,


Categories