Become a GOLD member of Deccansoft and get access to 40+ courses!!
NewBatches/Webinars
Packages
Gold Membership
Bestseller
Microsoft Azure Suite & Suite Plus
Power Platform Acadamy
New
Azure DevOps Expert & Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Courses
MS.NET Courses (Includes Live Project)
Complete C#, OOPs and Windows Programing
ASP.NET MVC Online Training
ASP.NET WebForms
ASP.NET Core
WCF incl. Web Services and Remoting
WPF incl. MVVM and Prism
LINQ and Entity Framework
Live Project Training for Developing Enterprise Application
Live Project using Ntier Arch (.NET5 + EF Core + Angular)
Microservices using .NET Core
Gold Membership
CareerStep IT Program
Client-side UI Technologies
Building Static Web Pages using HTML and CSS
JavaScript and HTML DOM
jQuery, AJAX and JSON
Building Interactive Web Pages using HTML5 and CSS3
BootStrap + Live Examples
AngularJS + Live Project
Angular + Typescript
ReactJS
KnockoutJS
Xamarin
SQL Server + MSBI
SQL Server 2017
Querying Data with Transact-SQL(70-761)
SQL Server Integration Service (SSIS)
SQL Server Reporting Service (SSRS)
SQL Service Analysis Service (SSAS)
Cloud Computing / Azure / AWS
AZ-900: Microsoft Azure Fundamentals
Azure Suite (AZ-104+AZ-204+AZ-305+ AZ-500)
AZ-104: Microsoft Azure Administrator
AZ-204: Developing Solutions for Microsoft Azure
AZ-305: Microsoft Azure Architect Technologies and Design
DP-203: Data Engineering on Microsoft Azure
Amazon Web Services (AWS)
DevOps Expert
AZ-400: Microsoft Azure DevOps
Docker by Sandeep Soni
Kubernetes by Sandeep Soni
Docker & Kubernetes by Rahul Rampurkar
IaC Using Terraform
Powershell
Microsoft Power Platform
Microsoft Power Platform
Data Analytics using PowerBI (DA-100)
Testing Tools
Manual Testing
Selenium Testing with Java(Live Training)
Others
Python Programming
C and Data Structure
Core Java
OOPs and C++
Advance Java
Complete Azure Training
Pricing
Videos
Testimonials
Azure Certification
Contact Us
Login
Login or Register
×
Sign In
Register
Forgot Password?
How did you find us
WhatsApp
YouTube
LinkedIn
Facebook
Telegram
Twitter
Google
Referred by Friend
Refresh
Input symbols
By clicking Register, you accept to the
terms and conditions
and that you have read our
privacy policy.
Recover Password
×
Submit
Enquiry Now
Where did you come to know about us
WhatsApp
YouTube
LinkedIn
Facebook
LinkedIn Ad
Email
Twitter
Google
Referred
Other
Refresh
Input symbols
Command Line Arguments and Variable Arguments
Interview Questions and Answer
1. How to declare main when it receives command-line arguments?
Options:
a. int main(int argc, char *argv[])
b. int main(argc, argv)
c. int main() { int argc; char *argv; }
d. None of Above
Reveal Answer
2. What is meant by the 'c' and 'v' in argv?
Options:
a. 'c' means argument count 'v' means argument vector
b. 'c' means argument control 'v' means argument vector
c. 'c' means argument count 'v' means argument vertex
d. None of above
Reveal Answer
3. How to write command line arguments if argument has a space?
Options:
a. “command line arguments”
b. % command line arguments %
c. ‘command line arguments’
d. & command line arguments
Reveal Answer
4. Even if integer or float type arguments are given at command prompt they are considered as strings.
Options:
a. True
b. False
Reveal Answer
5. Which of the following is invalid for the below code? int main(int first, char sec){ }
Options:
a. first contains count of arguments supplied at command-line
b. In place of first and sec, argc and argv should be used
c. sec[] contains addresses of arguments supplied at a command line
d. None of above
Reveal Answer
6. What will be the output of the program (cmd> prog one two three) given below if it is executed from the command line? #include<stdio.h> int main(int argc, char **argv) { printf("%c\n", **argv++); return 0; }
Options:
a. prog
b. prog one
c. c
d. compilation error
Reveal Answer
7. What will be the output of the program (cmd> trial 1 2 3) given below if it is executed from the command line? #include<stdio.h> int main(int argc, char *argv[]) { int i; i = argv[1] + argv[2] + argv[3]; printf("%d", i); return 0; }
Options:
a. 6
b. Trial 1 2 3
c. Error
d. Garbage value
Reveal Answer
8. argc refers to the Number of arguments passed from the command line arguments
Options:
a. True
b. False
Reveal Answer
9. argv() refers to the pointer array which points to each argument passed to the program.
Options:
a. True
b. False
Reveal Answer
10. If no arguments are supplied from command prompt then value of argc() contains
Options:
a. One
b. Zero
c. -1
d. Garbage value
Reveal Answer
11. What would be the output if we try to execute following code(assuming the following input deccan soft services)? printf(“%s\n”,argv[argc]);
Options:
a. Null
b. City
c. In
d. Segmentation fault
Reveal Answer
12. Which of the following header file provides functions and macros to implement the functionality of variable arguments?
Options:
a. stdio.h
b. stdlib..h
c. stdarg.h
d. conio.h
Reveal Answer
13. What has to create to define a function with last parameter as ellipses and the one just before the ellipses is always an int which will represent number of arguments.
Options:
a. int
b. float
c. char
d. pointer
Reveal Answer
14. Which symbol is used to declare indeterminate number of arguments?
Options:
a. …
b. !..
c. Arguments are separated by & symbol
d. …..
Reveal Answer
15. Command line arguments are:
Options:
a. Passed at runtime
b. passed at compile time
c. Passed to the main function during preprocessing of the program
d. passed during dynamic memory allocation
Reveal Answer
Packages
Gold Membership
Microsoft Azure Suite &Suite Plus
Azure DevOps Expert &Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Resources
Blog
Deccansoft
AzureA2Z
Wall of Fame
On-Job Tech Support
About
About BestDotNetTraining
About Trainer
Testimonials
FAQ
Other links
About Us
Contact Us
Leave us a feedback
Sitemap
Privacy Policy
Terms & Conditions
Proudly Powered by