how to multiply two number taking input as a string
(considering sum and carry )

Answers were Sorted based on User's Feedback



how to multiply two number taking input as a string (considering sum and carry )..

Answer / vengat

int i, b;
char a[4] = "63";
for (i = 0;i < 1;i++)
{

b = (a[i] - 48)+(a[i+1]-48);
printf("%d\n", b);
}

Is This Answer Correct ?    0 Yes 1 No

how to multiply two number taking input as a string (considering sum and carry )..

Answer / ravi

char a[3];
int i;
char s[3];
for(i=1;i<=3;i++)
s[i]=a[i]*2;
printf("%s",s[i]);

Is This Answer Correct ?    5 Yes 18 No

Post New Answer

More C Interview Questions

I have an array of 100 elements. Each element contains some text. i want to: append a star character to the end of every fifth element remove every second character from every tenth element, and… add a line feed (ascii 10) after the 30th character of every array element whose length is greater than 30 characters.

1 Answers  


write a c program to change only the 3rd bit of the particular number such that other bits are not affected.. if bitnum=10(say.. it can be any no..

10 Answers   Bosch, Mind Tree,


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

0 Answers  


write a programming in c to find the sum of all elements in an array through function.

0 Answers  


#include<string.h> void main() { String s1[]={"swathi"}; string s2[]={"maddimsetti"}; s1[]=s[]; printf("%s",s1[]); }

3 Answers   IBM,






What are static variables in c?

0 Answers  


what is unsigened char and what is the difference from char

2 Answers  


what is the advantage of function pointer

16 Answers   CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,


Explain what are compound statements?

0 Answers  


Does c have enums?

0 Answers  


what are the advantages of a macro over a function?

0 Answers   TCS,


Write a code to reverse string seperated by spaces i/p str=India is my country o/p str=aidnI si ym yrtnuoc After writing code, optimize the code

1 Answers  


Categories