#include<stdio.h>
void binaryCode(int n)
{
printf("1");
if(n<2)
return;
binaryCode(n-1);
int i=0;
for(;i<n;i++)
printf("0");
binaryCode(n-2);
}
void main()
{
binaryCode(3);
}
Output:- 1110010001
Question 8 Predict the output of the following C program: 5 #include <stdio.h> void binaryCode(int n)...
Question 3 Predict the output of the following C program: #include <stdio.h> void main() { int i = 0; for(; 1; i++){ printf("%d",i); if(i==7) break; } 12pt Paragraph 1 Β Ι Ο Αν και Ta
Question 5 10 pts Predict the output of the following C program: #include <stdio.h> void mainot double x[4] = (3.14, 1.62, 2.72,654.1); printf("%d %c %.f", (int)(100**(x+1)), (int)x[3]/10, x[2]); 12pt Paragraph BI UAB T2 : p O words
Question 2 Predict the output of the following program: #include <stdio.h> void mainot printf("%d %d %d" 10 > -1, (unsigned) 10 > -1, (unsigned) (10 > 1));
Question 6 Predict the output of the following question: 8 pts #include <stdio.h> #include<string.h> char al(5)={ "gate", "kate","rate","date" ); void rec(char a[][5], int n){ if(n<= 1) return; char temp[5]; strcpy(temp'a);//copies the string stored in a into temp strcpy(*a,a[n-1]); strcpy(a[n-1),temp); rec(a+1,n-2); } void main() { rec(a 4); int i = 0; for(;i<4;i++) a[i][4]+= 10; printf("%s", a); }
QUESTION 12 What is the output of the following program? #include <stdio.h> int main(void) printf("From sealnto shininginC"); O a. From sea to shining O b. From sea to shining O c. From seanto shining nC O d. From sea to shining C
OPERATING SYSTWM Question 31 What is the output of this C program? #include #include void main() int mptr, *cptr mptr = (int*)malloc(sizeof(int)); printf("%d", "mptr); cptr = (int)calloc(sizeof(int),1); printf("%d","cptr); garbage 0 000 O garbage segmentation fault Question 8 1 pts If this program "Hello" is run from the command line as "Hello 12 3" what is the output? (char '1'is ascii value 49. char '2' is ascii value 50 char'3' is ascii value 51): #include<stdio.h> int main (int argc, char*argv[]) int...
what is the output of the following program? #include<stdio.h> #include<string.h> int main(void){ char word[20]; int i =0 strcpy(word, "ORGANISE"); while(word[i] !='\0'){ if(i%2 ==1) word[i] = 'C'; i++; } printf("%s",word); return 0; }
What is going to be the output of the following program: # include <stdio.h> int main(void) {struct dob {int month; int day; int year;}; struct student {int sid; int yearOfAdmission; float currentGPA; struct dob bday; struct student stdnt = {123, 2015, 8.3, 11, 26, 1993}; printf(" Id is: %d \n", stdnt.sid); printf("Year of admission is: %d \n", stdnt.year OfAdmission); printf("Current GPA is: %.2f\n\n", stdnt.currentGPA); printf("Date of Birth is: %d/%d/%d", stdnt. bday. month, stdnt. bday.day, stdnt. bday.} return 0;}
5. Answer the questions on the following program: #include <signal.h> #include <stdio.h> #include <unistd.h> void ouch(int sig) { printf("OUCH! -‐ I got signal %d\n", sig); } int main() { signal(SIGINT, ouch); signal(SIGQUIT, ouch); while(1) { printf("Hello World!\n"); sleep(1); } } 1) What is the output of just running the program? 2) What will happen if you try to use both keyboard signals of terminal interrupt and terminal quit: Ctrl-‐C and Ctrl-‐\ to kill the process? 3) Give exactly necessary commends...
computers. 1. How many times will this loop repeat? include <stdlib.h> #include <stdio.h> void main(void) int 10 for(= 0; i < 101) printf("d", 1); A. 10 times B. 1 time C. It will run forever D. 0 times 2. What will be the output of this program? #include <stdlib.h> #include <stdio.h> int main() int a = 100, b = 200, C = 300; if(!a >= 500) b = 300; C = 400; printf("%d, 8d, &d", a, b, c); return 0;...