C - Programming ( Output based - Loop )

C - Programming ( Output based - Loop )

Professional Development

10 Qs

quiz-placeholder

Similar activities

 ครั้งที่ 2. ม.4 Servo กับ อัลตราโซนิกส์ (ultrasonics)

ครั้งที่ 2. ม.4 Servo กับ อัลตราโซนิกส์ (ultrasonics)

Professional Development

10 Qs

Accés a la xarxa (I)

Accés a la xarxa (I)

Professional Development

13 Qs

Evaluación de Salida - semana 4

Evaluación de Salida - semana 4

Professional Development

10 Qs

Python Data Structures & Statements

Python Data Structures & Statements

Professional Development

11 Qs

AppsLab_Q3

AppsLab_Q3

1st Grade - Professional Development

12 Qs

TUTOR VIRTUAL

TUTOR VIRTUAL

Professional Development

10 Qs

Google Slides (JFIB)

Google Slides (JFIB)

Professional Development

12 Qs

Unit 208 Understand Legal, Regulatory and Ethical Requirements

Unit 208 Understand Legal, Regulatory and Ethical Requirements

University - Professional Development

13 Qs

C - Programming ( Output based - Loop )

C - Programming ( Output based - Loop )

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Bhanu Pratap Rai

Used 56+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is the correct output for the program given below.

#include <stdio.h>

void main()

{

int arr[5],i=-1,z;

while(i<5)

arr[i]=++i;

for(i=0;i<5;i++)

printf (“ %d”,arr[i]);

}

0 1 2 3 4

0 -1 -2 -3 -4

-1 0 1 2 3 4

1 2 3 4 5

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of following prog . ?

#include <stdio.h>

void main()

{

int arr[]= {0,1,2,3,4};

int i, *p;

for(p=arr, i=0;p+i<=arr+4;p++,i++)

printf(“%d”,*(p+i));

}

0,2,4

0,1,2

0,2,3

2,3,4

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

which of the following statements is correct :

#include <stdio.h>

int main()

{

int i,x;

for(i=1;i<=(9%2 +i); i++)

{

x=(i*3 + i*2)/I;

printf("%d",x);

}

}

The code prints output as 5 10

The code prints output as 5 5 5 5

The code prints 5 infinite numbers of times

The code prints 20 infinite numbers of times

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of following prog . ?

#include <stdio.h>

void main()

{

static int arr[] ={2,3,4,5,6};

int i;

for(i=5;i>0;)

printf(“%d”,arr[--i]);

}

6 5 4 3 2

2 3 4 5 6

5 4 3 2 0

no output

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

The function test is coded as follows:

int test(int num)

{

int m,n=0;

while(num)

{

m=num%10;

if(m%2)

n=n+1;

num=num/10;

}

return(n);

}

What will be the values of x and y when the following statements are executed?

int x= test(135);

int y == test(246);

0,0

0,3

3,0

3,3

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is the correct output for the program given below.

#include <stdio.h>

void main()

{

char *p="hai friends",*p1;

p1=p;

while(*p!='\0') ++*p++;

printf("%s %s",p,p1);

}

hai friends

ibj!gsjfoet

ibj!gsjfoet hai friends

Error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is the correct output for the program given below.

Void main()

{ int i=0;

for(;++i;) ;

printf("%d",i);

}

0

1,2,3,4,5,.....

1

No Output

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?