c++ scanf

/* scanf example */
#include <stdio.h>

int main ()
{
  char str [80];
  int i;

  printf ("Enter your family name: ");
  scanf ("%79s",str);  
  printf ("Enter your age: ");
  scanf ("%d",&i);
  printf ("Mr. %s , %d years old.\n",str,i);
  printf ("Enter a hexadecimal number: ");
  scanf ("%x",&i);
  printf ("You have entered %#x (%d).\n",i,i);
  
  return 0;
}

4
2
ERB 95 points

                                    #include &lt;stdio.h&gt;

int main()
{
    int a, b, c;
    printf(&quot;Enter the first value:&quot;);
    scanf(&quot;%d&quot;, &amp;a);
    printf(&quot;Enter the second value:&quot;);
    scanf(&quot;%d&quot;, &amp;b);
    c = a + b;
    printf(&quot;%d + %d = %d\n&quot;, a, b, c);
    return 0;
}

4 (2 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
c++ reference scanf scanf(&quot;%s&quot;) in cpp what scanf c++ can i write scanf in cpp what is scanf used for c++ can we write scanf in c++ scanf in c++ codechef input using scanf c++ read with scanf cpp c++ scanf function scanf in c+ can you use scanf in c++ cpp reference scanf what scanf do in c++ scanf equivalent in c++ can we use scanf in c++ hwhat scanf in c++ what does scanf do in c++ scanf c++ how use c++ what is scanf which of the following is c++ equivalent for scanf() c++ using scanf how does scanf work in c++p c+ scanf scanf in c++ syntax what does scanf mean in c++ scanf in c++ example scanf function in cpp what does scanf do inc++ does scanf work in c++ scanf en C++ scanner in c language scanf integer in c c scanning integer #define c allow input scanf in c programming scanf c+ scanner syntax c scanf documentation scan command in C++ scanf works in c how to use scanf c++ cpp scan ln cpp scan using printf and scanf in c++ use scanf and printf in c++ take scanf in cpp how to scan int in cpp c scanf documentation &quot;[&quot; c++ printf input get int with scanf can scanf be used in c++ which header file to import for scanf_s() double scanf C++ scanf number scanf c int c++ scanf properties what is scanf in c++ scanf statement in c++ scanf function in c++ scanf for getting an int number scanf for int in c c scan int scanf in c++ scanf with integer c c get integer from scanf_s c get integer from scanf scanf cplusplus.com c++ scan string how does scanf work in c++ scanf integar c referace scanf scanf syntax in c++ printf and scanf in c++ how scanf workws in C scanf *int c++ scanf how to read string value to string c++ scan f use scanf cpp use scanf how to get input using scanf in c++ scanf char c++ scanf %s c++ how to take input using scanf in c++ scanf int c++ scanf STING and double C++ scanner c int c scanf example int what is scanf c++ library scanf with spaces c++ library scanf how to do scan function c %d scanf scanf Format string specifications of scanf in c++ c using scanf cplusplus scanf using scanf and printf in c++ scanf(%llx,&amp;input) scanf %d c++ c++ scanf base scanf string on c++ scanf integer c scanf and printf in cpp scan in integer c scanf in cpp how to get an integer input using scanf in c++ scanf arguments scanf() in c++ 14 scanf printf cpp scanf(&quot;%d&quot;, &amp;n) to c++ scanf integer the command scanf(&quot;%d %d&quot;, &amp;x, &amp;y); scanf sting c++ scanf parameters string input c++ char scanf c++ scanf types scanf library what is the use of scanf in c++ what does scanf does in c++ scanf int c c++ scanf %D c scanf int take input c++ scanf is scanf c or cpp how to use scanf and printf in c++ scanf from comman c++ c++ print f scan f cpp scanf scanf string c++ scanf into c++ string c++ scanf &quot;string&quot; scanf reading a string c++ 15 how to read a string c++ scand scanf printf in c++ printf scanf c++ input a string using scanf cpp scanf char string c++ scnaf string c++ printf scanf in c++ scanf example scanf in c++ for string scanf on string c++ scanf and printf c++ scanf printf c++ c scanf hex into long how to use scanf in c++ c++ scanf example how to write message for scanf in c++ c++ how to use scanf scanf not scanning the long data type c++ take input c++ scanf scanf syntax c++ scanf in c++ scan int c++ scan c++ how to use scanf c++ scanf string scanf int scanf c++ example cpp scanf int scan int c printf and scanf in cpp scanf what is the access specifier for scanf in c++ scanf cpp int scanf c++ c++ how to use scanf c++ scanf scan_f c++ scanf c++
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source