
C Language
Authored by Sahitya Satya
Computers
University
Used 14+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
#include <stdio.h>
void change(int,int);
int main()
{
int a=15,b=16;
change(a,b);
printf("Value of a is: %d",a);
printf("\n");
printf("Value of b is: %d",b);
return 0;
}
void change(int x,int y)
{
x=13;
y=17;
}
What will be the output:-
Value of a is: 15 Value of b is: 16
Value of a is: 13 Value of b is: 17
Value of a is: 16 Value of b is: 15
Value of a is: 17 Value of b is: 13
2.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Correct way to initialize an array in C programming Language is:-
int num[6] = { 1, 2, 3, 4, 5};
int num[6] = { 1, 2, 3, 16, 25, 45, 9 };
int a={};
int x{3}={2,3,4};
3.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
The correct output of given code snippet is:-
#include<stdio.h>
void main()
{
int a[5]= {1,2,1,4,9};
int i, j, k;
i= ++a[1];
j= a[1]++;
k= a[1++];
printf("%d, %d, %d", i, j, k);
}
3, 4, 1
2, 2, 9
4, 3, 4
3, 3, 1
4.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
The correct Code to swap two numbers in C language without using a third variable is:-
#include<stdio.h>
int main()
{
int a=10, b=20;
printf("Before swap a=%d b=%d",a,b);
a=a-b;
b=a-b;
a=a+b;
printf("\nAfter swap a=%d b=%d",a,b);
}
#include<stdio.h>
int main()
{
int a=10, b=20;
printf("Before swap a=%d b=%d",a,b);
a=a+b;
b=a+b;
a=a-b;
printf("\nAfter swap a=%d b=%d",a,b);
}
#include<stdio.h>
int main()
{
int a=10, b=20;
printf("Before swap a=%d b=%d",a,b);
a=a+b;
b=a-b;
a=a+b;
printf("\nAfter swap a=%d b=%d",a,b);
}
#include<stdio.h>
int main()
{
int a=10, b=20;
printf("Before swap a=%d b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("\nAfter swap a=%d b=%d",a,b);
}
5.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
The correct output of given code snippet is:-
#include<stdio.h>
int main()
{
int x=5;
printf("%d", x<<1);
return 0;
}
0
5
10
1
Answer explanation
The bitwise left shift operator(<<) shifts all bits towards the left by a certain number of specified bits. The expression x<<1 always returns x*2
6.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
Which code snippet will be executed faster:-
a) #include<stdio.h>
int main()
{
int x=5;
printf("%d", x++);
return 0;
}
b)#include<stdio.h>
int main()
{
int x=5;
printf("%d", x+=1); // same as x=x+1
return 0;
}
Only b
Only a
Both will take same time
It depends on compiler
Answer explanation
x++ being a unary operation, it just needs one variable. Whereas, x = x + 1 is a binary operation that adds overhead to take more time.
7.
MULTIPLE CHOICE QUESTION
1 min • 10 pts
During function call, Default Parameter Passing Mechanism is called as
Call by Reference
Call by Address
Call by Name
Call by Value
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
INTRODUCCION A LA PROGRAMACION
Quiz
•
6th Grade - University
13 questions
GIT COURSE
Quiz
•
University
10 questions
Machine Learning (Introduction)
Quiz
•
University
10 questions
Entorno Financiero Digital 2do test
Quiz
•
University
11 questions
Determining System Requirements
Quiz
•
University
15 questions
1.1.1 The structure and function of the processor
Quiz
•
11th Grade - University
10 questions
Google Apps
Quiz
•
10th Grade - Professi...
14 questions
ITF Chapter 1 Computing Devices
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade