quizz

Beschreibung

quizz
aman.sinha42
Quiz von aman.sinha42, aktualisiert more than 1 year ago
aman.sinha42
Erstellt von aman.sinha42 vor etwa 9 Jahre
14
0

Zusammenfassung der Ressource

Frage 1

Frage
Which of the following statements are correct about an if-else statements in a C-program? 1: Every if-else statement can be replaced by an equivalent statements using ?: operators 2: Nested if-else statements are allowed. 3: Multiple statements in an if block are allowed. 4: Multiple statements in an else block are allowed.
Antworten
  • 1 and 2
  • 2 and 3
  • 1, 2 and 4
  • 2, 3, 4

Frage 2

Frage
Point out the error, if any in the for loop. #include<stdio.h> int main() { int i=1; for(;;) { printf("%d\n", i++); if(i>10) break; } return 0; }
Antworten
  • There should be a condition in the for loop
  • The two semicolons should be dropped
  • The for loop should be replaced with while loop.
  • No error

Frage 3

Frage
8 What is x in the following program? #include<stdio.h> int main() { typedef char (*(*arrfptr[3])())[10]; arrfptr x; return 0; }
Antworten
  • x is a pointer
  • x is an array of three pointer
  • x is an array of three function pointers
  • Error in x declaration

Frage 4

Frage
How will you free the memory allocated by the following program? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int **p, i, j; p = (int **) malloc(MAXROW * sizeof(int*)); return 0; }
Antworten
  • memfree(int p);
  • dealloc(p);
  • malloc(p, 0);
  • free(p);
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Secrets from the Science of Persuasion
Mme Guitton
How much do you know about India ?
AnFlo
A380 Theory Exam Practice
Tom_NZ
INFORMATION SYSTEMS FOR MANAGERS - Quizz #1
boumiza.hakim
QUIZZ PAST CONTINUOUS
kevin gomez
VERB "TO BE"
english journey
Who Says the following Quotes in Richard the Third?
jbryant97
SOBRE LA TECNOLOGIA DE LA INFORMACION
KALETH DAVID PALACIOS SUAREZ
Lets learn more about China
Marie Averseng