Write a c-programe that input one number of four digits and find digits sum?
Answers were Sorted based on User's Feedback
Answer / erdem
{
int num, sum ;
printf("Enter digit 1\n");
scanf("%d",num);
sum=sum+num;
for(i=1;i<4;i++)
{
printf("Enter digit %d\n",i);
scanf("%d",num);
sum=sum+num;
}
printf("the sum of digits is %d",sum);
getche();
| Is This Answer Correct ? | 6 Yes | 1 No |
{
int sum,digit1,digit2,digit3,digit4;
printf("enter the four digit number\n");
scanf("%d",digit1,digit2,digit3,digit4);
digit1=(digit1%1000)/10;
digit2=(digit2%1000)/10;
digit3=(digit3%1000)/10;
digit4=(digit4%1000)/10;
sum=digit1+digit2+digit3+digit4;
printf("the sum of digits is %d",sum);
return(0);
}
| Is This Answer Correct ? | 1 Yes | 7 No |
Write a program to accept two strings of Odd lengths. Then take all odd characters from one string and even characters from the other and concatenate and produce a string.
What is probability to guarantee that the task a programmer is going to create will be created and be able to run on a particular system (RTOS/GPOS).
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
A sample program using data structure? what is file handling?
How to upgrade LOOP environment, I just mean, how can i make loop statement editable ? I just try some program using loop statement and checking it in multiple compilers. Every compiler showing different output, what's the wrong ? is it a compiler based problem, or loop based problem, tell me why ? and what will be the debugging process, for this kind of problem ?
what is exceptions?
which typw of errors ? & how to solve it ?
quoroum of computer languages?
Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?
printy(a=3,a=2)
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf("%d%d%d",x,y,z); }