Answers for "scanf c library"

4

c scanf

scanf("%d",&variable);

/*
% is a format specifier

%d or %i 		for int
%ld or %li for 	long int
%f for 			float
%lf for 		double
%c for 			char
%s for 			string
*/
Posted by: Guest on February-11-2021
2

scanf c

scanf("%d", &b);
Posted by: Guest on September-24-2020
1

scanf c library

#include <stdio.h>

int main () {
   char str1[20], str2[30];

   printf("Enter name: ");
   scanf("%s", str1);

   printf("Enter your website name: ");
   scanf("%s", str2);

   printf("Entered Name: %s\n", str1);
   printf("Entered Website:%s", str2);
   
   return(0);
}
Posted by: Guest on June-21-2021

Browse Popular Code Answers by Language