1. Engineering
  2. Computer Science
  3. what is the output of following programs briefly explain your...

Question: what is the output of following programs briefly explain your...

Question details

What is the output of following programs? Briefly explain your answer.

1. Program 1: # include <stdio.h> void foo (int x) double a-100 double b-40; x- a*a int main int y= 20 foo (y); printf(%d, y); return 0;

2. Program 2: # include <stdio.h> void foo (int *ptr) double a 10; double b-4; ptraa +4*b+5; imt main ( int y-20 foo(&y) printf(%d, y); return 0

3. Program 3: #include 〈stdio.h〉 int main double *ptr; double x; ptr&x; *ptr = 10.254575; printf(* printf(* x %0.2f\n, *ptr=%f , x); *ptr ) ; *ptr 10; printf(* x = %f\n”, x); printf(* *ptr=%f , *ptr ) ; (*ptr)++; printf(* x %0.4f\n, x); printf(* *ptr= %0.4f , *ptr); return 0;

4. Program 4: #include<stdio.h> void foo (int *p, int *q) int int a=10; b-б; *pbb+10*a; int i = 0, j int main () 2 foo(&i , &j); printf(%d %d , i, j); getchar (O; return 0;

5. Program 5: #include<stdio.h〉 void swap (char *x, char *y) char *t =x; int main char *x -Computer Systems; char *y = CSCI 2271. char *t swap (x, y); printf((%s, %s) , x, y); printf((%s, return 0; %s), x, y);

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution