Recent questions tagged goclasses-cs-dpp-day-29

7 7 votes
2 2 answers
615
615 views
What is the output of the following code?#include <stdio.h int main() { int val[] = {5, 10, 15}; int *ptr = val; *ptr++ = 20; printf("%d %d %d\n", val[0], ptr , val ); re...
7 7 votes
2 2 answers
640
640 views
What is the output of the code given below?#include<stdio.h int main() { char name[] = "satellites"; int len; int size; len = strlen(name); size = sizeof(name); printf("%...
6 6 votes
4 4 answers
916
916 views
Consider the following recursive C function.unsigned int f(unsigned int n) { if (n < 10) printf("%d",n); else { printf("%d", n%10); f(n/10); printf("%d", n%10); } }What d...
5 5 votes
3 3 answers
580
580 views
What string does the following program print?#include <stdio.h #include <string.h void strFunc2 (char A[], int n) { char t; if (n <= 1) return; t = A[0]; A[0] = A[n-1]; A...
7 7 votes
2 2 answers
816
816 views
Let the function g be defined as follows:int g ( int n ) { if (n < 2) return n; return g(n/2); }What is the value returned by the call $\mathrm{g}(142857)$ ?$0$ $1$ $2$ $...
To see more, click for the full list of questions or popular tags.