Find greatest number out of 10 number without using loop.
Answer Posted / satya
#include<stdio.h>
void main()
{
static int big=0,a=0,cnt=0;
printf("enter number");
scanf("%d",&a);
if(a>big)
big=a;
if(cnt<=10)
{
cnt++
main();
}
printf("largest number amongest 10 numbers is :%d",big);
}
| Is This Answer Correct ? | 4 Yes | 11 No |
Post New Answer View All Answers
Which is best book for data structures in c?
What is the use of #include in c?
What does %2f mean in c?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Explain 'bus error'?
What is the purpose of void pointer?
Why isnt there a numbered, multi-level break statement to break out
What is the value of uninitialized variable in c?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What’s a signal? Explain what do I use signals for?
Explain what are multibyte characters?
When is a void pointer used?
What does the characters “r” and “w” mean when writing programs that will make use of files?
In a switch statement, what will happen if a break statement is omitted?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?