0% found this document useful (0 votes)
33 views3 pages

India Fmri

The document contains 8 code snippets that demonstrate basic C programming concepts like arithmetic operations, conditional statements, loops, and more. Each snippet is followed by its output. The snippets show: 1) Arithmetic operations like addition, subtraction, multiplication, division, and modulus. 2) A conditional statement to check eligibility to vote. 3) Pre-increment, post-increment, pre-decrement, and post-decrement operators. 4) A while loop to print numbers from 1 to 10. 5) A do-while loop to print a single number. 6) A for loop to print numbers from 0 to 10. 7) Nested if statements.

Uploaded by

Arasu Bhv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views3 pages

India Fmri

The document contains 8 code snippets that demonstrate basic C programming concepts like arithmetic operations, conditional statements, loops, and more. Each snippet is followed by its output. The snippets show: 1) Arithmetic operations like addition, subtraction, multiplication, division, and modulus. 2) A conditional statement to check eligibility to vote. 3) Pre-increment, post-increment, pre-decrement, and post-decrement operators. 4) A while loop to print numbers from 1 to 10. 5) A do-while loop to print a single number. 6) A for loop to print numbers from 0 to 10. 7) Nested if statements.

Uploaded by

Arasu Bhv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Problem_1

=========

#include<stdio.h>
void main()
{
int x=20,y=10;
int z=x+y;
int f=x-y;
int g=x*y;
int h=x/y;34uydgbe bxw s 2exbix
int i=x%y;
printf("value of z is %d",z);
printf("value of f is %d",f);
printf("value of g is %d",g);
printf("value of h is %d",h);
lor3f4rfw4rnfw4jfwr 4noi4gio4f4 w4igi56of4
printf("value of i is %d",i);
}
int z=x+y;
int f=x-y;
int g=x*y;
int h=x/y;34uydgbe bxw s 2exbix
int i=x%y;

Output;
=======

value of z is 30value of f is 10value of g is 200value of h is 2value of i is 0

=================================================================================

Problem_2
=========

#include<stdio.h>
int main()
{
int age=20;
if(age>18)
{
printf("person eligible to vote");
}
else
{
printf("person not eligible to vote");
}
}

Output;
=======

person eligible to vote

=================================================================================

Problem-3
=========
#include<stdio.h>
int main()
{
int a=15,b=25;
printf("value of a is %d",a++);
printf("value of b is %d",++b);
printf("value of a is %d",++a);
printf("value of b is %d",b++);
}

Output;
=======

value of a is 15value of b is 26value of a is 17value of b is 26

=================================================================================

Problem-4
=========

#include<stdio.h>
int main()
{
int i=1;
while(i<=10)
{
printf("%d\t",i);
i++;
}
}

Output;
=======

1 2 3 4 5 6 7 8 9 10

==================================================================================

Problem-5
=========

#include<stdio.h>
int main()
{
int i=15;
do
{
printf("%d\t",i);
i++;
}
while(i<15);
}

Output;
=======

15

===================================================================================
Problem-6
=========

#include<stdio.h>
int main()
{
int i;
for(i=0;i<=10;i++)
{
printf("%d\t",i);
}
}

Output;
=======

0 1 2 3 4 5 6 7 8 9 10

===================================================================================

Problem-7
=========

#include<stdio.h>
int main()
{
int g=18;
if(g>15)
if(g==18)
{
printf("value equal to 18");
}
if(g>20)
{
printf("value greater than");
}
else
{
printf("condition not satisfied");
}
}

Output;
=======

value equal to 18condition not satisfied

===================================================================================
=

Problem-8
=========

You might also like