C programming 2021 Solution
2) WAP to display all the numbers from 100 to 200 divisible by 4
1 2 3 4 5 |
#include<stdio.h> void main(){ for(int i=100;i<=200;i++) i%4==0? printf("%d ",i):i; } |
3) Create a function int greater(int ,int ) that returns greater number.
1 2 3 |
int greater(int a,int b){ return a>b? a : b; } |
5)check if string is palindrome or not
1 2 3 4 5 6 7 8 9 10 11 12 |
#include<stdio.h> #include<string.h> void main(){ char string[100],temp[100]; printf("enter string"); gets(string); strcpy(temp,string); strrev(string); if(strcmp(string,temp)==0) printf("the string is palindrome"); else printf("the string is not palindrome"); } |
6)A data file contains name ,age ,address,cell number of some students WAP to list all the students who are […]
Continue Reading