10. Write a c program to add two numbers without using addition operator.
11. Write a c program to subtract two numbers without using subtraction operator.
15. Write a c program to solve quadratic equation.
18. Write a c program which passes structure to function.
28. Write a c program which takes password from user.
29. Write a scanf function in c which accept sentence from user.
30. Write a scanf function in c which accept paragraph from user.
34 comments:
what is the code for following pattern
1 2 3 9 4 5 6 18 7 8 9 27...
what is the code for following pattern
1 2 3 9 4 5 6 18 7 8 9 27...
#include
int main(void)
{
int n=9, i;
for(i=1; i<=9; i++)
{
printf("%d ", i);
if(i%3==0)
printf("%d ", i*3);
}
printf("\n");
return 0;
}
a. words in the sentence should be even.
b.swap first word from last word and also swap alternate word from end.
input : I am responsible for what I say and I am not responsible for what I understand
output : Understand am what for responsible I am and I say not what for responsible you I .
write a program to display following putput- USE FOR LOOP.
12345
1234
123
12
1
-pratikc003@gmail.com
#include
int main(void)
{
int i,j;
for(i=5; i>0; i--)
{
for(j=1; j<=i; j++)
{
printf("%d",j);
}
printf("\n");
}
return 0;
}
printf("1 2 3 9 4 5 6 18 7 8 9 27...");
/* Guess who just got OWNED
Good one!!!
I did thought this one but not so cleanly...
#include
#include
int main(int argc, const char * argv[])
{
int i,n;
printf("Enter n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("%d ",i);
if(i%3==0)
printf("%d ",i*3);
}
return 0;
}
code for it.
h
he
hel
hell
hello
give me the code of file reading and finding no of line and char
why is the condition true for if(printf("Hi"))? like why is the test condition true for the if statement. plss explain...
simple and clear...
thank u... its simple and clear
why we use system("pause")
#include
void main()
{
int i,j;
printf("Your out put is here:\n");
for(i=5;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
}
#include
#include
void main(){
char str[5] = "Hello";
int len = strlen(str);
int i,j;
for(i=0;i<len;i++)
{
for(j=0;j<=i;j++)
{
printf("%c",str[j]);
}
printf("\n");
}
}
for (int i=5;i>0; i--) {
for (int j=1;j<i; j++) {
printf("%d",j);
}
printf("\n");
}
#include
main()
{
int i,n;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%3==0)
printf("%d %d ",i,i*3);
else
printf("%d ",i);
}
}
make a program that will display the word "Hello", "I'm Fine" and "Thank you" in different lines and column.
..please help me with this :)
void main()
{
printf("%s","Hello\n");
printf("%15s","i am Fine\n");
printf("%25s","Thank You\n");
getch();
}
#include
int main()
{
int i,j,n,p;
printf("enter the limit");
scanf("%d",&n);
p=n;
for(i=1;i<=p;i++)
{
for(j=1;j<=n;j++)
{
printf("%d",j);
}
printf("\n");
n=n-1;
}
}
#include
#include
int main()
{
char g[55];
int n,i;
printf("enter the string");
gets(g);
n=strlen(g);
for(i=0;i<n;i++)
{
if(g[i]==' ')
printf("\n");
else
printf("%c",g[i]);
}
}
#include
int main()
{
int i = 0;
int n = 0;
int count = 0;
int value = 0;
printf("\n Enter the range till you need to print : ");
scanf("%d",&n);
// printf("\n Enter the multiple value you need to print : ");
// scanf("%d",&value);
value = 9; //For the serious you need to print
for(i=1;i<=n;i++)
{
printf("%d ",i);
if(i%3==0)
{
count++;
printf("%d %d ", (count*value));
}
}
return 0;
}
You Just Waste memory by Initializing int n & dosen't use it further in Program
printf() will just print the string when called, wherever it's placed, just that it prints the string then returns a 0 on success. using "if" or other stuff are just to avoid the usage of ;.
because printf function always returns length of the string that is going to print, i.e. a non-zero integer, thats why if condition will be true in this case.
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Why we can print any sentence without using semicolon?
Write a function that takes a list of strings an prints them, one per line, in a rectangular frame
For example the list ["Hello", "World", "in", "a", "frame"] gets printed as:
*********
* Hello *
* World *
* in *
* a *
* frame *
*********
please could anybody solve this in C
thnks
can anyone please suggest me to write a program to print ,(comma) without using comma operator in whole program.
Print the output as
1 99 2 98 3 ....
Post a Comment