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

Can an ECE graduate with some knowledge of C language learn SQL?
Yes ECE graduate student learn SQL languuage bcuz SQL is. A structured query language. it all query depends upon the logic. In which table is used Nd database is maitained
Anand
0 0
5
Why is there no C-- language that simplifies the C language?
Creating C-- to simplify C isn't necessary; evolving languages like Rust, Go, or C++ offer modern alternatives.
Komal
0 0
7
What are the types of linkages in C Programming?
EXTERNAL,INTERNAL,NONE are 3 types of linkage in C programming
Akash
0 0
9
What is the structure of a C program?
A C program typically starts with preprocessor directives, followed by global variable declarations. It then defines functions, one of which must be the main() function, serving as the entry point. The...
Igno
0 0
5
What is "&" called in C language?
In the C programming language, the "&" symbol is called the "address-of" operator. It is used to obtain the memory address of a variable. When you use "&" followed by a variable name, it provides...
Soumya
0 0
5

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

Ask a Question

Related Lessons

Operators in C
Operators in C Operator: An operator is a symbol that tells the compiler to perform certain mathematical or logical calculations. Operators are used in programs to manipulate data and variables. The...

Internet of Things, Social Media Becoming Part of E-Discovery Landscape
The days when e-discovery consisted of handing over copies of e-mails to address Freedom of Information Act (FOIA) requests, compliance regulations or other legal obligations are over. Now, it's just as...

C Program Sample Application
//Standard Library Functions(Header Files used) #include<stdio.h> #include <conio.h> //Main method int main() { // function for clearing screen clrscr(); // function to print the output...

All About Programming And A Good Programmer.
Hi, This is my first lesson for you guys. Hope you enjoy reading it. In recent community questions, I found many people wanted to be good programmers, or wanted to have good hands on certain language,...

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

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