Answers for "c printf /n"

C
1

printf in c

#include <stdio.h>

int printf(const char *format, ...);

int main(void)
{
  int nb = 20;
 
  printf("Hello World !n");
  printf("%dn", nb);
  printf("%s/%dn", "Nice", 20);
  return (0);
}

/// output :
///
///	Hello World !
///	20
///	Nice/20
///
Posted by: Guest on March-03-2020
0

printf n characters c

// Only 5 characters printed. When using %.*s, add a value before your string variable to specify the length.
printf("Here are the first 5 characters: %.*sn", 5, mystr); //5 here refers to # of characters
Posted by: Guest on June-19-2020

Code answers related to "C"

Browse Popular Code Answers by Language