TECHNICAL C PROGRAM

TECHNICAL C PROGRAM

University

10 Qs

quiz-placeholder

Similar activities

Arrays in C (II yr 02.07.2020)

Arrays in C (II yr 02.07.2020)

University

10 Qs

TECHNICAL C POINTER JIT04

TECHNICAL C POINTER JIT04

University

8 Qs

Plot the Code

Plot the Code

University

10 Qs

Basics of C

Basics of C

University

10 Qs

FIND THE KEY

FIND THE KEY

University

10 Qs

BASIC C QUIZ

BASIC C QUIZ

University

15 Qs

C programming-1

C programming-1

University

13 Qs

C Program Array and strings

C Program Array and strings

University

10 Qs

TECHNICAL C PROGRAM

TECHNICAL C PROGRAM

Assessment

Quiz

Computers

University

Hard

Created by

GOWSIKRAJA P

Used 130+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

int main() { unsigned int i=65000; while ( i++ != 0 ); printf("%d",i); return 0; }

PREDICT THE OUTPUT OR ERROR

1

2

3

SYNTAX ERROR

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

int main() {

short i;

for (i = 1; i >= 0; i++)

printf("%d\n", i);

}

STATE THE OUTPUT

The control won’t fall into the for loop

Numbers will be displayed until the signed limit of short and throw a runtime error

Numbers will be displayed until the signed limit of short and program will successfully terminate

This program will get into an infinite loop and keep printing numbers with no errors

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

#include <stdio.h>

void main() {

int array[30], temp[30], i, j, k, l, num; //using 2 arrays

printf("Enter the number of lines to be printed: "); scanf("%d", &num);

temp[0] = 1;

array[0] = 1;

for (j = 0; j < num; j++)

printf(" "); printf(" 1\n");

for (i = 1; i < num; i++)

{ for (j = 0; j < i; j++)

printf(" ");

for (k = 1; k < num; k++)

{ array[k] = temp[k - 1] + temp[k];

} array[i] = 1; for (l = 0; l <= i; l++)

{ printf("%3d", array[l]);

temp[l] = array[l];

} printf("\n");

}

}

Enter the number of lines to be printed: 4

1

1 1

1 2 1

1 3 3 1

Enter the number of lines to be printed: 4

1

1 1

1 1 1

1 1 1 1

Enter the number of lines to be printed: 4

*

* *

* * *

* * * *

Enter the number of lines to be printed: 4

1

2 2

3 3 3

4 4 4 4

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

void main() { char a = 'a'; int x = (a % 10)++; printf("%d\n", x); }

GUESS THE OUTPUT

Grabage Value

Compiler Error

Output: 10

Output: 0

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

void main() {

int k = 0;

for (k < 3; k++)

printf("Hello");

}

Compile time error

Hello is printed thrice

Nothing

Varies

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

void main()

{

double k = 0;

for (k = 0.0; k < 3.0; k++)

printf("Hello");

}

Run time error

Hello is printed thrice

Hello is printed twice

Hello is printed infinitely

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

int main() {

int i = 0;

for (; ; ;)

printf("In for loop\n");

printf("After loop\n");

}

a) Compile time error

b) Infinite loop

c) After looP

d) Undefined behaviour

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?