UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the output of the below: int x, y; printf("%d", scanf("%d %d", &x, &Y));

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

"8 years experienced tutor (C, C++, Mathematics, Computer science)" by passion & "CCNA certified Python developer on Cisco network security platforms" by profession. Good with C, C++, Python, PyATS, Core Java, Networking, Linux, MCSE.

:) Good one. It checks my eye sight. This piece of code would result in an error: "undefined symbol Y". Note: 'scanf( )' not only scans and loads the values entered by users into variables, but it also returns a number which is the count of the number of variables that are successfully scanned by...
read more
:) Good one. It checks my eye sight. This piece of code would result in an error: "undefined symbol Y". Note: 'scanf( )' not only scans and loads the values entered by users into variables, but it also returns a number which is the count of the number of variables that are successfully scanned by itself. So, in this example if the upper case 'Y' in 'scanf( )' is replaced with lower case 'y', the scanf( ) would return 2 on successfully scanning the input values (say 10 and 20) to memory. read less
Comments

Tutor

Answer will no of variable read by scanf that is "2". and please make sure "Y" is not capital, because C is case sensitive language
Comments

Experienced IT Professional with 5 years of experience in Tutoring Programming subjects

scanf is used for reading inputs from the user. So user will be prompted to enter 2 integer numbers. scanf returns the number of successfully read inputs. suppose I entered 15 20 printf is used to prints the value of the variables or value returned by any function. In our case it will print the...
read more
scanf is used for reading inputs from the user. So user will be prompted to enter 2 integer numbers. scanf returns the number of successfully read inputs. suppose I entered 15 20 printf is used to prints the value of the variables or value returned by any function. In our case it will print the output or return value of the scanf function which will be 2. So complete output will be: 15 20 2 read less
Comments

Tutor

Output is 2. why? ans. printf function will count the number of variables that has been scanned because you specify %d which refers to integer.
Comments

Are you looking for an Expert Friendly Tutor?

2
Comments

Tutor

It would not compile at the very first. So, there is no scope to run this program. Conclusion is, it would not print anything on the output window.
Comments

Tutor

It would not compile at very first. So, there is no scope to run this code. Finally, it would not print anything on the output window.
Comments

Python trainer

Hi Pravalika, First thing is you should not ask questions like this (o/p of program etc..), as you can always verify with any compiler you use. You should always ask questions like why such thing..? (Ex. you can ask why the o/p of above program is 5?) Thanks, Janardhan.
Comments

First of all writing such code is not valid but still output concern it is 2, because scanf is library function and it have two parameters
Comments

Trainer

2
Comments

View 48 more Answers

Related Questions

What purpose does \n have in C programming?
is used for new line. It prints the output in New or next line
Nasar
0 0
9
The object file is in binary code, and the machine understands the binary language. So why object files are not executed?
Object files are sources compiled into binary machine language, but they do not have library files, so they are not executed.
Dhruvil
0 0
9
What is the difference between a string and an array?
An array is an array of anything. A string is a specific kind of an array with a well-known convention to determine its length. There are two kinds of programming languages: those in which a string is...
Rakes
What is C language?
C is a general-purpose, procedural programming language that was developed in the early 1970s by Dennis Ritchie at Bell Labs. It is a low-level language, which means it provides a relatively simple and...
Vikram
0 0
7

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Features Of C Language
Features of C language It is a robust language with rich set of built-in functions and operators that can be used to write any complex program. The C compiler combines the capabilities of an assembly...

Can we store different data types in a stack?
Yesterday, one of my Facebook friend asked me this question. My answer is "yes", and in this post I will discuss how could we do this.I am a great supporter of working with unions and I will be using union...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

Array vs Linked List
Array Linked List Accessing element is easy. Accessing element is difficult compare to Array. Easy to use. Difficult to use. Memory is Fixed size. Memory is variable size. If...

4 Things Every Tech Startup Needs to Know About The Coaching Industry
Knowledge on any subject is widely available to those who wish to learn. However, just gathering knowledge from other people doesn’t guarantee results in business. Results come from applying what...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more