If you print the binary digits just like that, they'll be in the wrong order (lsb to msb). Below program uses recursion to print the digits msb to lsb. Just for fun.
void printBits(unsigned int n)
{
if (n > 1) {
printBits(n >> 1);
}
printf((n & 1) ? "1" : "0");
}
int main()
{
unsigned int number;
printf("Enter an integer number: ");
scanf_s("%d", &number);
printBits(number);
}
Answer:
The balanced DFD (Data flow diagram) is the concept of the balancing all the state and incoming and also outgoing flow in the system.
The balanced data flow diagram basically ensure that the output and input data flow maintain the consistency in the DFD and are properly aligned the flow of data.
A balanced DFD does not include any type of flowchart in the control statement and also does not contain any crossing lines.
Answer:
#include<stdio.h>
#include<string.h>
int main(){
char str[20];
int i=0;
printf("Enter a name: ");
gets(str);
printf("%c",*str);
while(str[i]!='\0'){
if(str[i]==' '){
i++;
printf("%c",*(str+i));
}
i++;
}
return 0;
}
Explanation:
Let us consider a, b, c, d, e, f the six numbers.
If the average of 6 numbers is 19 then
(a + b + c + d + e + f)/6 = 19
=> a + b + c + d + e + f = 114 (1)
And if the average of 5 numbers is 20 then
(a + b + c + d + e)/5 = 20
=> a + b + c + d + e = 100 (2)
We will replace (2) in (1) And it will result that
100 + f = 114 => f=114, the sixth number.