Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,884 questions

51,810 answers

573 users

How to print a string without using printf() and puts() in C

4 Answers

0 votes
#include <stdio.h>

int main(void)
{
  char *s = "c c++ c# java python php";
    
  fputs(s, stdout);
}



/*
run:
 
c c++ c# java python php

*/

 



answered Sep 28, 2017 by avibootz
edited Nov 8, 2024 by avibootz
0 votes
#include <stdio.h>

int main(void)
{
  char *s = "c c++ c# java python php";
    
  fprintf(stdout, "%s", s);
}



/*
run:
 
c c++ c# java python php

*/

 



answered Sep 28, 2017 by avibootz
edited Nov 8, 2024 by avibootz
0 votes
#include <stdio.h> 
#include <string.h> 

int main(void)
{
  char *s = "c c++ c# java python php";
  int len = strlen(s);
    
  for (int i = 0; i < len; i++) 
      putc(s[i], stdout);
}



/*
run:
 
c c++ c# java python php

*/

 



answered Sep 28, 2017 by avibootz
edited Nov 8, 2024 by avibootz
0 votes
#include <stdio.h> 
#include <string.h> 
#include <unistd.h>

int main(void)
{
  char *s = "c c++ c# java python php";
    
  write(1, s, strlen(s));
}



/*
run:
 
c c++ c# java python php

*/

 



answered Sep 28, 2017 by avibootz
edited Nov 8, 2024 by avibootz

Related questions

1 answer 211 views
1 answer 156 views
156 views asked Dec 29, 2023 by avibootz
1 answer 146 views
1 answer 194 views
1 answer 158 views
1 answer 140 views
1 answer 125 views
125 views asked Jun 6, 2023 by avibootz
...